channel/rail: add UI event handling.
This commit is contained in:
parent
2378b989ff
commit
327ad2607c
@ -76,33 +76,102 @@ static void rail_process_receive(rdpSvcPlugin* plugin, STREAM* s)
|
||||
stream_free(s);
|
||||
}
|
||||
|
||||
void rail_recv_set_sysparams_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
static void rail_process_plugin_data(rdpRailOrder* rail_order, RDP_PLUGIN_DATA* data)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
static void rail_recv_set_sysparams_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RDP_PLUGIN_DATA* data;
|
||||
RAIL_SYSPARAM_ORDER* sysparam;
|
||||
|
||||
/* Send System Parameters */
|
||||
|
||||
sysparam = (RAIL_SYSPARAM_ORDER*)event->user_data;
|
||||
memmove(&rail_order->sysparam, sysparam, sizeof(RAIL_SYSPARAM_ORDER));
|
||||
|
||||
rail_send_client_sysparams_order(rail_order);
|
||||
|
||||
/* execute */
|
||||
|
||||
rail_order->exec.flags =
|
||||
RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY |
|
||||
RAIL_EXEC_FLAG_EXPAND_ARGUMENTS;
|
||||
rail_order->exec.flags = RAIL_EXEC_FLAG_EXPAND_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_process_plugin_data(rail_order, data);
|
||||
data = (RDP_PLUGIN_DATA*)(((void*)data) + data->size);
|
||||
}
|
||||
}
|
||||
|
||||
static void rail_recv_exec_remote_app_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RDP_PLUGIN_DATA* data = (RDP_PLUGIN_DATA*)event->user_data;
|
||||
|
||||
rail_process_plugin_data(rail_order, data);
|
||||
}
|
||||
|
||||
static void rail_recv_activate_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_ACTIVATE_ORDER* activate = (RAIL_ACTIVATE_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->activate, activate, sizeof(RAIL_ACTIVATE_ORDER));
|
||||
rail_send_client_activate_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_sysmenu_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_SYSMENU_ORDER* sysmenu = (RAIL_SYSMENU_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->sysmenu, sysmenu, sizeof(RAIL_SYSMENU_ORDER));
|
||||
rail_send_client_sysmenu_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_syscommand_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_SYSCOMMAND_ORDER* syscommand = (RAIL_SYSCOMMAND_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->syscommand, syscommand, sizeof(RAIL_SYSCOMMAND_ORDER));
|
||||
rail_send_client_syscommand_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_notify_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_NOTIFY_EVENT_ORDER* notify = (RAIL_NOTIFY_EVENT_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->notify_event, notify, sizeof(RAIL_NOTIFY_EVENT_ORDER));
|
||||
rail_send_client_notify_event_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_window_move_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_WINDOW_MOVE_ORDER* window_move = (RAIL_WINDOW_MOVE_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->window_move, window_move, sizeof(RAIL_WINDOW_MOVE_ORDER));
|
||||
rail_send_client_window_move_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_app_req_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_GET_APPID_REQ_ORDER* get_appid_req = (RAIL_GET_APPID_REQ_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->get_appid_req, get_appid_req, sizeof(RAIL_GET_APPID_REQ_ORDER));
|
||||
rail_send_client_get_appid_req_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_recv_langbarinfo_event(rdpRailOrder* rail_order, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_LANGBAR_INFO_ORDER* langbar_info = (RAIL_LANGBAR_INFO_ORDER*)event->user_data;
|
||||
|
||||
memcpy(&rail_order->langbar_info, langbar_info, sizeof(RAIL_LANGBAR_INFO_ORDER));
|
||||
rail_send_client_langbar_info_order(rail_order);
|
||||
}
|
||||
|
||||
static void rail_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
|
||||
{
|
||||
railPlugin* rail = NULL;
|
||||
@ -114,6 +183,38 @@ static void rail_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
|
||||
rail_recv_set_sysparams_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP:
|
||||
rail_recv_exec_remote_app_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE:
|
||||
rail_recv_activate_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_SYSMENU:
|
||||
rail_recv_sysmenu_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND:
|
||||
rail_recv_syscommand_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_NOTIFY_EVENT:
|
||||
rail_recv_notify_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE:
|
||||
rail_recv_window_move_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_APPID_REQ:
|
||||
rail_recv_app_req_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_RAIL_CLIENT_LANGBARINFO:
|
||||
rail_recv_langbarinfo_event(rail->rail_order, event);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -338,6 +338,7 @@ enum RDP_EVENT_TYPE_RAIL
|
||||
RDP_EVENT_TYPE_RAIL_CHANNEL_LANGBARINFO,
|
||||
|
||||
RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS,
|
||||
RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP,
|
||||
RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE,
|
||||
RDP_EVENT_TYPE_RAIL_CLIENT_SYSMENU,
|
||||
RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND,
|
||||
|
Loading…
Reference in New Issue
Block a user