From 1cfd1bdc5876661090e25e1085b3e743a3c3cead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 17 Sep 2013 15:42:36 -0400 Subject: [PATCH] libfreerdp-common: parse more .rdp file settings --- client/common/file.c | 105 +++++++++++++++++++++++++++++++++++ include/freerdp/settings.h | 2 +- libfreerdp/common/settings.c | 8 +++ 3 files changed, 114 insertions(+), 1 deletion(-) diff --git a/client/common/file.c b/client/common/file.c index e48e1251f..9250f916a 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -712,12 +712,52 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~((size_t) file->ShellWorkingDirectory)) freerdp_set_param_string(settings, FreeRDP_ShellWorkingDirectory, file->ShellWorkingDirectory); + if (~file->ScreenModeId) + { + /** + * Screen Mode Id: + * http://technet.microsoft.com/en-us/library/ff393692/ + * + * This setting corresponds to the selection in the Display + * configuration slider on the Display tab under Options in RDC. + * + * Values: + * + * 0: The remote session will appear in a window. + * 1: The remote session will appear full screen. + */ + + freerdp_set_param_bool(settings, FreeRDP_Fullscreen, + (file->ScreenModeId == 1) ? TRUE : FALSE); + } + if (~((size_t) file->LoadBalanceInfo)) { settings->LoadBalanceInfo = (BYTE*) _strdup(file->LoadBalanceInfo); settings->LoadBalanceInfoLength = strlen((char*) settings->LoadBalanceInfo); } + if (~file->AuthenticationLevel) + { + /** + * Authentication Level: + * http://technet.microsoft.com/en-us/library/ff393709/ + * + * This setting corresponds to the selection in the If server authentication + * fails drop-down list on the Advanced tab under Options in RDC. + * + * Values: + * + * 0: If server authentication fails, connect to the computer without warning (Connect and don’t warn me). + * 1: If server authentication fails, do not establish a connection (Do not connect). + * 2: If server authentication fails, show a warning and allow me to connect or refuse the connection (Warn me). + * 3: No authentication requirement is specified. + */ + + freerdp_set_param_bool(settings, FreeRDP_IgnoreCertificate, + (file->AuthenticationLevel == 0) ? TRUE : FALSE); + } + if (~file->ConnectionType) freerdp_set_param_uint32(settings, FreeRDP_ConnectionType, file->ConnectionType); @@ -790,6 +830,71 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->BitmapCachePersistEnable) freerdp_set_param_bool(settings, FreeRDP_BitmapCachePersistEnabled, file->BitmapCachePersistEnable); + if (~file->DisableRemoteAppCapsCheck) + freerdp_set_param_bool(settings, FreeRDP_DisableRemoteAppCapsCheck, file->DisableRemoteAppCapsCheck); + + if (~file->AutoReconnectionEnabled) + freerdp_set_param_bool(settings, FreeRDP_AutoReconnectionEnabled, file->AutoReconnectionEnabled); + + if (~file->RedirectSmartCards) + freerdp_set_param_bool(settings, FreeRDP_RedirectSmartCards, file->RedirectSmartCards); + + if (~file->RedirectClipboard) + freerdp_set_param_bool(settings, FreeRDP_RedirectClipboard, file->RedirectClipboard); + + if (~file->RedirectPrinters) + freerdp_set_param_bool(settings, FreeRDP_RedirectPrinters, file->RedirectPrinters); + + if (~file->RedirectDrives) + freerdp_set_param_bool(settings, FreeRDP_RedirectDrives, file->RedirectDrives); + + if (~file->RedirectPosDevices) + { + freerdp_set_param_bool(settings, FreeRDP_RedirectSerialPorts, file->RedirectComPorts); + freerdp_set_param_bool(settings, FreeRDP_RedirectParallelPorts, file->RedirectComPorts); + } + + if (~file->RedirectComPorts) + { + freerdp_set_param_bool(settings, FreeRDP_RedirectSerialPorts, file->RedirectComPorts); + freerdp_set_param_bool(settings, FreeRDP_RedirectParallelPorts, file->RedirectComPorts); + } + + if (~file->RedirectDirectX) + { + /* What is this?! */ + } + + if (~((size_t) file->DevicesToRedirect)) + { + /** + * Devices to redirect: + * http://technet.microsoft.com/en-us/library/ff393728/ + * + * This setting corresponds to the selections for Other supported Plug and Play + * (PnP) devices under More on the Local Resources tab under Options in RDC. + * + * Values: + * + * '*': + * Redirect all supported Plug and Play devices. + * + * 'DynamicDevices': + * Redirect any supported Plug and Play devices that are connected later. + * + * The hardware ID for the supported Plug and Play device: + * Redirect the specified supported Plug and Play device. + * + * Examples: + * devicestoredirect:s:* + * devicestoredirect:s:DynamicDevices + * devicestoredirect:s:USB\VID_04A9&PID_30C1\6&4BD985D&0&2;,DynamicDevices + * + */ + + freerdp_set_param_bool(settings, FreeRDP_RedirectDrives, TRUE); + } + return TRUE; } diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index d99d24161..02697579d 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -1046,7 +1046,7 @@ struct rdp_settings ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */ ALIGN64 DWORD RemoteApplicationExpandCmdLine; /* 2119 */ ALIGN64 DWORD RemoteApplicationExpandWorkingDir; /* 2120 */ - ALIGN64 DWORD DisableRemoteAppCapsCheck; /* 2121 */ + ALIGN64 BOOL DisableRemoteAppCapsCheck; /* 2121 */ ALIGN64 UINT32 RemoteAppNumIconCaches; /* 2122 */ ALIGN64 UINT32 RemoteAppNumIconCacheEntries; /* 2123 */ ALIGN64 BOOL RemoteAppLanguageBarSupported; /* 2124 */ diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 1df6ba1a3..ffcf1937f 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -616,6 +616,10 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id) return settings->RemoteApplicationMode; break; + case FreeRDP_DisableRemoteAppCapsCheck: + return settings->DisableRemoteAppCapsCheck; + break; + case FreeRDP_RemoteAppLanguageBarSupported: return settings->RemoteAppLanguageBarSupported; break; @@ -1071,6 +1075,10 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param) settings->RemoteApplicationMode = param; break; + case FreeRDP_DisableRemoteAppCapsCheck: + settings->DisableRemoteAppCapsCheck = param; + break; + case FreeRDP_RemoteAppLanguageBarSupported: settings->RemoteAppLanguageBarSupported = param; break;