From 0af6c7d22a7b504cb6a970dcbf855442a77074a0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 5 Oct 2014 15:16:28 -0700 Subject: [PATCH] GUAC-874: Load RDPDR and set device redirection if audio enabled. --- configure.ac | 12 ++++++++++++ src/protocols/rdp/client.c | 3 ++- src/protocols/rdp/rdp_settings.c | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f1b38533..20170888 100644 --- a/configure.ac +++ b/configure.ac @@ -374,6 +374,7 @@ then legacy_freerdp_extensions=no rdpsettings_interface=unknown rdpsettings_audioplayback=yes + rdpsettings_deviceredirection=yes freerdp_interface=unknown event_interface=unknown @@ -601,6 +602,11 @@ then [rdpsettings_audioplayback=no], [[#include ]]) + # Legacy interface may not have DeviceRedirection settings + AC_CHECK_MEMBERS([rdpSettings.device_redirection],, + [rdpsettings_deviceredirection=no], + [[#include ]]) + elif test "x${rdpsettings_interface}" = "xunknown"; then AC_MSG_WARN([ -------------------------------------------- @@ -617,6 +623,12 @@ if test "x${have_freerdp}" = "xyes" -a "x${rdpsettings_audioplayback}" = "xyes"; [Whether the rdpSettings structure has AudioPlayback settings]) fi +# Activate device redirection settings if present +if test "x${have_freerdp}" = "xyes" -a "x${rdpsettings_deviceredirection}" = "xyes"; then + AC_DEFINE([HAVE_RDPSETTINGS_DEVICEREDIRECTION],, + [Whether the rdpSettings structure has DeviceRedirection settings]) +fi + # Check if the type CHANNEL_ENTRY_POINTS_FREERDP exists, if not define it to CHANNEL_ENTRY_POINTS_EX if test "x${have_freerdp}" = "xyes" then diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 95281e66..a4d76c0e 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -193,7 +193,8 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) { /* If RDPDR required, load it */ if (guac_client_data->settings.printing_enabled - || guac_client_data->settings.drive_enabled) { + || guac_client_data->settings.drive_enabled + || guac_client_data->settings.audio_enabled) { /* Load RDPDR plugin */ if (freerdp_channels_load_plugin(channels, instance->settings, diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index f9689363..1fd2d411 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -116,6 +116,21 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) { #ifdef HAVE_RDPSETTINGS_AUDIOPLAYBACK rdp_settings->AudioPlayback = guac_settings->audio_enabled; #endif +#endif + + /* Device redirection */ +#ifdef LEGACY_RDPSETTINGS +#ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION + rdp_settings->device_redirection = guac_settings->audio_enabled + || guac_settings->drive_enabled + || guac_settings->printing_enabled; +#endif +#else +#ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION + rdp_settings->DeviceRedirection = guac_settings->audio_enabled + || guac_settings->drive_enabled + || guac_settings->printing_enabled; +#endif #endif /* Security */