From 68879cc2ecc20dc89ebb5c7fdaa441f3d47b2a2a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 29 Jan 2014 16:25:30 -0800 Subject: [PATCH] Init RemoteApp settings. Load RAIL plugin. --- src/protocols/rdp/client.c | 28 ++++++++++++++++++++++++++++ src/protocols/rdp/rdp_settings.c | 16 ++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 02e2e504..7cfcf9d0 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -188,6 +188,34 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) { } + /* Load RAIL plugin if RemoteApp in use */ + if (guac_client_data->settings.remote_app_name != NULL + || guac_client_data->settings.remote_app_command != NULL) { + +#ifdef LEGACY_FREERDP + RDP_PLUGIN_DATA* plugin_data = malloc(sizeof(RDP_PLUGIN_DATA) * 2); + + plugin_data[0].size = sizeof(RDP_PLUGIN_DATA); + plugin_data[0].data[0] = guac_client_data->settings.remote_app_name; + plugin_data[0].data[1] = guac_client_data->settings.remote_app_command; + plugin_data[0].data[2] = NULL; + plugin_data[0].data[3] = NULL; + + plugin_data[1].size = 0; + + /* Attempt to load rail */ + if (freerdp_channels_load_plugin(channels, instance->settings, + "rail", plugin_data)) + guac_client_log_error(client, "Failed to load rail plugin."); +#else + /* Attempt to load rail */ + if (freerdp_channels_load_plugin(channels, instance->settings, + "rail", instance->settings)) + guac_client_log_error(client, "Failed to load rail plugin."); +#endif + + } + /* Init color conversion structure */ clrconv = calloc(1, sizeof(CLRCONV)); clrconv->alpha = 1; diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index 9439ee8f..6a24e4c8 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -169,6 +169,22 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) { rdp_settings->DisableEncryption = FALSE; #endif + /* RemoteApp */ + if (guac_settings->remote_app_name != NULL + || guac_settings->remote_app_command != NULL) { +#ifdef LEGACY_RDPSETTINGS + rdp_settings->workarea = TRUE; + rdp_settings->remote_app = TRUE; + rdp_settings->rail_langbar_supported = TRUE; +#else + rdp_settings->Workarea = TRUE; + rdp_settings->RemoteApplicationMode = TRUE; + rdp_settings->RemoteAppLanguageBarSupported = TRUE; + rdp_settings->RemoteApplicationProgram = guac_settings->remote_app_name; + rdp_settings->RemoteApplicationCmdLine = guac_settings->remote_app_command; +#endif + } + /* Order support */ #ifdef LEGACY_RDPSETTINGS bitmap_cache = rdp_settings->bitmap_cache;