From 42ba19dd98aa7c333b4e8af2e88b669a0e0e40a9 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 22 May 2019 16:36:40 +0200 Subject: [PATCH] Added rail workdir parameter --- client/common/cmdline.c | 5 +++++ client/common/cmdline.h | 1 + include/freerdp/settings.h | 4 +++- libfreerdp/common/settings_getters.c | 8 ++++++++ libfreerdp/core/test/settings_property_lists.h | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 0bca7a5..4726e85 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -2172,6 +2172,11 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, settings->DisableWallpaper = TRUE; settings->DisableFullWindowDrag = TRUE; } + CommandLineSwitchCase(arg, "app-workdir") + { + if (!copy_value(arg->Value, &settings->RemoteApplicationWorkingDir)) + return COMMAND_LINE_ERROR_MEMORY; + } CommandLineSwitchCase(arg, "load-balance-info") { if (!copy_value(arg->Value, (char**)&settings->LoadBalanceInfo)) diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 321a5e5..7e2ee8d 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -34,6 +34,7 @@ static COMMAND_LINE_ARGUMENT_A args[] = { "app-guid", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Remote application GUID" }, { "app-icon", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Remote application icon for user interface" }, { "app-name", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Remote application name for user interface" }, + { "app-workdir", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Remote application workspace path" }, { "assistance", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Remote assistance password" }, { "async-channels", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Asynchronous channels (experimental)" }, { "async-input", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Asynchronous input" }, diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 4841b10..9104561 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -768,6 +768,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; #define FreeRDP_RemoteWndSupportLevel (2125) #define FreeRDP_RemoteApplicationSupportLevel (2126) #define FreeRDP_RemoteApplicationSupportMask (2127) +#define FreeRDP_RemoteApplicationWorkingDir (2128) #define FreeRDP_ReceivedCapabilities (2240) #define FreeRDP_ReceivedCapabilitiesSize (2241) #define FreeRDP_OsMajorType (2304) @@ -1268,7 +1269,8 @@ struct rdp_settings ALIGN64 UINT32 RemoteWndSupportLevel; /* 2125 */ ALIGN64 UINT32 RemoteApplicationSupportLevel; /* 2126 */ ALIGN64 UINT32 RemoteApplicationSupportMask; /* 2127 */ - UINT64 padding2176[2176 - 2128]; /* 2128 */ + ALIGN64 char* RemoteApplicationWorkingDir; /* 2128 */ + UINT64 padding2176[2176 - 2129]; /* 2129 */ UINT64 padding2240[2240 - 2176]; /* 2176 */ /** diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index baf8158..1953004 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -2281,6 +2281,9 @@ const char* freerdp_settings_get_string(rdpSettings* settings, size_t id) case FreeRDP_RemoteApplicationCmdLine: return settings->RemoteApplicationCmdLine; + case FreeRDP_RemoteApplicationWorkingDir: + return settings->RemoteApplicationWorkingDir; + case FreeRDP_ImeFileName: return settings->ImeFileName; @@ -2605,6 +2608,11 @@ BOOL freerdp_settings_set_string(rdpSettings* settings, size_t id, const char* v settings->RemoteApplicationCmdLine = _strdup(val); return settings->RemoteApplicationCmdLine != NULL; + case FreeRDP_RemoteApplicationWorkingDir: + free(settings->RemoteApplicationWorkingDir); + settings->RemoteApplicationWorkingDir = _strdup(val); + return settings->RemoteApplicationWorkingDir != NULL; + case FreeRDP_ImeFileName: free(settings->ImeFileName); settings->ImeFileName = _strdup(val); diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 5e75222..2f9b3c1 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -361,6 +361,7 @@ static const size_t string_list_indices[] = FreeRDP_RemoteApplicationFile, FreeRDP_RemoteApplicationGuid, FreeRDP_RemoteApplicationCmdLine, + FreeRDP_RemoteApplicationWorkingDir, FreeRDP_ImeFileName, FreeRDP_DrivesToRedirect, }; -- 2.7.4