mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
rail: support passing multiple apps and arguments using plugin data.
This commit is contained in:
@@ -79,6 +79,7 @@ static void rail_process_connect(rdpSvcPlugin* plugin)
|
||||
rail->rail_data_sender.send_rail_vchannel_data = rail_send_vchannel_data;
|
||||
|
||||
rail->rail_order = rail_order_new();
|
||||
rail->rail_order->plugin_data = (FRDP_PLUGIN_DATA*)plugin->channel_entry_points.pExtendedData;
|
||||
rail->rail_order->data_sender = &(rail->rail_data_sender);
|
||||
rail->rail_order->event_sender = &(rail->rail_event_sender);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ struct _RAIL_VCHANNEL_EVENT_SENDER
|
||||
struct rdp_rail_order
|
||||
{
|
||||
UNICONV* uniconv;
|
||||
FRDP_PLUGIN_DATA* plugin_data;
|
||||
RAIL_HANDSHAKE_ORDER handshake;
|
||||
RAIL_CLIENT_STATUS_ORDER client_status;
|
||||
RAIL_EXEC_ORDER exec;
|
||||
|
||||
@@ -65,10 +65,13 @@ void rail_string_to_unicode_string(rdpRailOrder* rail_order, char* string, UNICO
|
||||
char* buffer;
|
||||
size_t length = 0;
|
||||
|
||||
if (unicode_string->string != NULL)
|
||||
xfree(unicode_string->string);
|
||||
|
||||
unicode_string->string = NULL;
|
||||
unicode_string->length = 0;
|
||||
|
||||
if (strlen(string) < 1)
|
||||
if (string == NULL || strlen(string) < 1)
|
||||
return;
|
||||
|
||||
buffer = freerdp_uniconv_out(rail_order->uniconv, string, &length);
|
||||
@@ -282,6 +285,8 @@ void rail_write_langbar_info_order(STREAM* s, RAIL_LANGBAR_INFO_ORDER* langbar_i
|
||||
|
||||
void rail_recv_handshake_order(rdpRailOrder* rail_order, STREAM* s)
|
||||
{
|
||||
FRDP_PLUGIN_DATA* data;
|
||||
|
||||
rail_read_handshake_order(s, &rail_order->handshake);
|
||||
|
||||
rail_order->handshake.buildNumber = 0x00001DB1;
|
||||
@@ -334,11 +339,17 @@ void rail_recv_handshake_order(rdpRailOrder* rail_order, STREAM* s)
|
||||
RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY |
|
||||
RAIL_EXEC_FLAG_EXPAND_ARGUMENTS;
|
||||
|
||||
rail_string_to_unicode_string(rail_order, "||cmd", &rail_order->exec.exeOrFile);
|
||||
rail_string_to_unicode_string(rail_order, "", &rail_order->exec.workingDir);
|
||||
rail_string_to_unicode_string(rail_order, "", &rail_order->exec.arguments);
|
||||
data = rail_order->plugin_data;
|
||||
while (data && data->size > 0)
|
||||
{
|
||||
rail_string_to_unicode_string(rail_order, (char*)data->data[0], &rail_order->exec.exeOrFile);
|
||||
rail_string_to_unicode_string(rail_order, (char*)data->data[1], &rail_order->exec.workingDir);
|
||||
rail_string_to_unicode_string(rail_order, (char*)data->data[2], &rail_order->exec.arguments);
|
||||
|
||||
rail_send_client_exec_order(rail_order);
|
||||
rail_send_client_exec_order(rail_order);
|
||||
|
||||
data = (FRDP_PLUGIN_DATA*)(((void*)data) + data->size);
|
||||
}
|
||||
}
|
||||
|
||||
void rail_order_recv(rdpRailOrder* rail_order, STREAM* s)
|
||||
|
||||
@@ -263,7 +263,6 @@ struct rdp_settings
|
||||
boolean rfx_decode;
|
||||
boolean frame_acknowledge;
|
||||
|
||||
uint8* app_name;
|
||||
boolean remote_app;
|
||||
|
||||
boolean mouse_motion;
|
||||
|
||||
@@ -186,15 +186,8 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
{
|
||||
settings->mouse_motion = 0;
|
||||
}
|
||||
else if (strcmp("--app", argv[index]) == 0)
|
||||
else if (strcmp("--remote-app", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if (index == argc)
|
||||
{
|
||||
printf("missing application name\n");
|
||||
return 0;
|
||||
}
|
||||
settings->app_name = (uint8*) xstrdup(argv[index]);
|
||||
settings->remote_app = True;
|
||||
}
|
||||
else if (strcmp("-x", argv[index]) == 0)
|
||||
|
||||
Reference in New Issue
Block a user