static void cliprdr_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
{
- switch (event->event_type)
+ switch (GetMessageType(event->id))
{
case CliprdrChannel_FormatList:
cliprdr_process_format_list_event((cliprdrPlugin*) plugin, (RDP_CB_FORMAT_LIST_EVENT*) event);
break;
default:
- DEBUG_WARN("unknown event type %d", event->event_type);
+ DEBUG_WARN("unknown event type %d", GetMessageType(event->id));
break;
}
if (status == 0)
{
- DEBUG_DVC("event_type %d pushed.", pEvent->event_type);
+ DEBUG_DVC("event_type %d pushed.", GetMessageType(pEvent->id));
}
else
{
- DEBUG_WARN("event_type %d push failed.", pEvent->event_type);
+ DEBUG_WARN("event_type %d push failed.", GetMessageType(pEvent->id));
}
return status;
static void on_free_rail_channel_event(RDP_EVENT* event)
{
- rail_free_cloned_order(event->event_type, event->user_data);
+ rail_free_cloned_order(GetMessageType(event->id), event->user_data);
}
void rail_send_channel_event(void* rail_object, UINT16 event_type, void* param)
{
RAIL_ACTIVATE_ORDER* activate = (RAIL_ACTIVATE_ORDER*) event->user_data;
- memcpy(&rail_order->activate, activate, sizeof(RAIL_ACTIVATE_ORDER));
+ CopyMemory(&rail_order->activate, activate, sizeof(RAIL_ACTIVATE_ORDER));
rail_send_client_activate_order(rail_order);
}
{
RAIL_SYSMENU_ORDER* sysmenu = (RAIL_SYSMENU_ORDER*) event->user_data;
- memcpy(&rail_order->sysmenu, sysmenu, sizeof(RAIL_SYSMENU_ORDER));
+ CopyMemory(&rail_order->sysmenu, sysmenu, sizeof(RAIL_SYSMENU_ORDER));
rail_send_client_sysmenu_order(rail_order);
}
{
RAIL_SYSCOMMAND_ORDER* syscommand = (RAIL_SYSCOMMAND_ORDER*) event->user_data;
- memcpy(&rail_order->syscommand, syscommand, sizeof(RAIL_SYSCOMMAND_ORDER));
+ CopyMemory(&rail_order->syscommand, syscommand, sizeof(RAIL_SYSCOMMAND_ORDER));
rail_send_client_syscommand_order(rail_order);
}
{
RAIL_NOTIFY_EVENT_ORDER* notify = (RAIL_NOTIFY_EVENT_ORDER*) event->user_data;
- memcpy(&rail_order->notify_event, notify, sizeof(RAIL_NOTIFY_EVENT_ORDER));
+ CopyMemory(&rail_order->notify_event, notify, sizeof(RAIL_NOTIFY_EVENT_ORDER));
rail_send_client_notify_event_order(rail_order);
}
{
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));
+ CopyMemory(&rail_order->window_move, window_move, sizeof(RAIL_WINDOW_MOVE_ORDER));
rail_send_client_window_move_order(rail_order);
}
{
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));
+ CopyMemory(&rail_order->get_appid_req, get_appid_req, sizeof(RAIL_GET_APPID_REQ_ORDER));
rail_send_client_get_appid_req_order(rail_order);
}
{
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));
+ CopyMemory(&rail_order->langbar_info, langbar_info, sizeof(RAIL_LANGBAR_INFO_ORDER));
rail_send_client_langbar_info_order(rail_order);
}
railPlugin* rail = NULL;
rail = (railPlugin*) plugin;
- switch (event->event_type)
+ switch (GetMessageType(event->id))
{
- case RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS:
+ case RailChannel_ClientSystemParam:
rail_recv_set_sysparams_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP:
+ case RailChannel_ClientExecute:
rail_recv_exec_remote_app_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE:
+ case RailChannel_ClientActivate:
rail_recv_activate_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_SYSMENU:
+ case RailChannel_ClientSystemMenu:
rail_recv_sysmenu_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND:
+ case RailChannel_ClientSystemCommand:
rail_recv_syscommand_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_NOTIFY_EVENT:
+ case RailChannel_ClientNotifyEvent:
rail_recv_notify_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE:
+ case RailChannel_ClientWindowMove:
rail_recv_window_move_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_APPID_REQ:
+ case RailChannel_ClientGetAppIdRequest:
rail_recv_app_req_event(rail->rail_order, event);
break;
- case RDP_EVENT_TYPE_RAIL_CLIENT_LANGBARINFO:
+ case RailChannel_ClientLanguageBarInfo:
rail_recv_langbarinfo_event(rail->rail_order, event);
break;
BOOL rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength)
{
- if(stream_get_left(s) < 4)
+ if (stream_get_left(s) < 4)
return FALSE;
stream_read_UINT16(s, *orderType); /* orderType (2 bytes) */
stream_read_UINT16(s, *orderLength); /* orderLength (2 bytes) */
BOOL rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake)
{
- if(stream_get_left(s) < 4)
+ if (stream_get_left(s) < 4)
return FALSE;
stream_read_UINT32(s, handshake->buildNumber); /* buildNumber (4 bytes) */
return TRUE;
BOOL rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* exec_result)
{
- if(stream_get_left(s) < 8)
+ if (stream_get_left(s) < 8)
return FALSE;
stream_read_UINT16(s, exec_result->flags); /* flags (2 bytes) */
stream_read_UINT16(s, exec_result->execResult); /* execResult (2 bytes) */
{
BYTE body;
- if(stream_get_left(s) < 5)
+ if (stream_get_left(s) < 5)
return FALSE;
stream_read_UINT32(s, sysparam->param); /* systemParam (4 bytes) */
stream_read_BYTE(s, body); /* body (1 byte) */
BOOL rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo)
{
- if(stream_get_left(s) < 20)
+ if (stream_get_left(s) < 20)
return FALSE;
stream_read_UINT32(s, minmaxinfo->windowId); /* windowId (4 bytes) */
stream_read_UINT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */
BOOL rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize)
{
UINT16 isMoveSizeStart;
- if(stream_get_left(s) < 12)
+ if (stream_get_left(s) < 12)
return FALSE;
stream_read_UINT32(s, localmovesize->windowId); /* windowId (4 bytes) */
BOOL rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp)
{
- if(stream_get_left(s) < 516)
+ if (stream_get_left(s) < 516)
return FALSE;
stream_read_UINT32(s, get_appid_resp->windowId); /* windowId (4 bytes) */
stream_read(s, &get_appid_resp->applicationIdBuffer[0], 512); /* applicationId (256 UNICODE chars) */
BOOL rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info)
{
- if(stream_get_left(s) < 4)
+ if (stream_get_left(s) < 4)
return FALSE;
stream_read_UINT32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
return TRUE;
BOOL rail_recv_handshake_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_handshake_order(s, &rail_order->handshake))
+ if (!rail_read_handshake_order(s, &rail_order->handshake))
return FALSE;
rail_order->handshake.buildNumber = 0x00001DB0;
rail_order->sysparam.workArea.bottom = 768;
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS, &rail_order->sysparam);
+ RailChannel_GetSystemParam, &rail_order->sysparam);
+
return TRUE;
}
BOOL rail_recv_exec_result_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_server_exec_result_order(s, &rail_order->exec_result))
+ if (!rail_read_server_exec_result_order(s, &rail_order->exec_result))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS, &rail_order->exec_result);
+ RailChannel_ServerExecuteResult, &rail_order->exec_result);
+
return TRUE;
}
BOOL rail_recv_server_sysparam_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_server_sysparam_order(s, &rail_order->sysparam))
+ if (!rail_read_server_sysparam_order(s, &rail_order->sysparam))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM, &rail_order->sysparam);
+ RailChannel_ServerSystemParam, &rail_order->sysparam);
+
return TRUE;
}
BOOL rail_recv_server_minmaxinfo_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_server_minmaxinfo_order(s, &rail_order->minmaxinfo))
+ if (!rail_read_server_minmaxinfo_order(s, &rail_order->minmaxinfo))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_MINMAXINFO, &rail_order->minmaxinfo);
+ RailChannel_ServerMinMaxInfo, &rail_order->minmaxinfo);
+
return TRUE;
}
BOOL rail_recv_server_localmovesize_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_server_localmovesize_order(s, &rail_order->localmovesize))
+ if (!rail_read_server_localmovesize_order(s, &rail_order->localmovesize))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE, &rail_order->localmovesize);
+ RailChannel_ServerLocalMoveSize, &rail_order->localmovesize);
+
return TRUE;
}
BOOL rail_recv_server_get_appid_resp_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_server_get_appid_resp_order(s, &rail_order->get_appid_resp))
+ if (!rail_read_server_get_appid_resp_order(s, &rail_order->get_appid_resp))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP, &rail_order->get_appid_resp);
+ RailChannel_ServerGetAppIdResponse, &rail_order->get_appid_resp);
+
return TRUE;
}
BOOL rail_recv_langbar_info_order(rdpRailOrder* rail_order, wStream* s)
{
- if(!rail_read_langbar_info_order(s, &rail_order->langbar_info))
+ if (!rail_read_langbar_info_order(s, &rail_order->langbar_info))
return FALSE;
+
rail_send_channel_event(rail_order->plugin,
- RDP_EVENT_TYPE_RAIL_CHANNEL_LANGBARINFO, &rail_order->langbar_info);
+ RailChannel_ServerLanguageBarInfo, &rail_order->langbar_info);
+
return TRUE;
}
UINT16 orderType;
UINT16 orderLength;
- if(!rail_read_pdu_header(s, &orderType, &orderLength))
+ if (!rail_read_pdu_header(s, &orderType, &orderLength))
return FALSE;
DEBUG_RAIL("Received %s PDU, length:%d",
break;
default:
- printf("df_process_channel_event: unknown event type %d\n", event->event_type);
+ printf("df_process_channel_event: unknown event type %d\n", GetMessageType(event->id));
break;
}
void wf_process_cliprdr_event(wfInfo* wfi, RDP_EVENT* event)
{
- switch (event->event_type)
+ switch (GetMessageType(event->id))
{
- case RDP_EVENT_TYPE_CB_MONITOR_READY:
+ case CliprdrChannel_MonitorReady:
wf_cliprdr_process_cb_monitor_ready_event(wfi);
break;
- case RDP_EVENT_TYPE_CB_FORMAT_LIST:
+ case CliprdrChannel_FormatList:
wf_cliprdr_process_cb_format_list_event(wfi, (RDP_CB_FORMAT_LIST_EVENT*) event);
break;
- case RDP_EVENT_TYPE_CB_DATA_REQUEST:
+ case CliprdrChannel_DataRequest:
wf_cliprdr_process_cb_data_request_event(wfi, (RDP_CB_DATA_REQUEST_EVENT*) event);
break;
- case RDP_EVENT_TYPE_CB_DATA_RESPONSE:
+ case CliprdrChannel_DataResponse:
wf_cliprdr_process_cb_data_response_event(wfi, (RDP_CB_DATA_RESPONSE_EVENT*) event);
break;
static void xf_on_free_rail_client_event(RDP_EVENT* event)
{
- rail_free_cloned_order(event->event_type, event->user_data);
+ rail_free_cloned_order(GetMessageType(event->id), event->user_data);
}
static void xf_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param)
activate.windowId = rail_window->windowId;
activate.enabled = enabled;
- xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE, &activate);
+ xf_send_rail_client_event(channels, RailChannel_ClientActivate, &activate);
}
void xf_rail_send_client_system_command(xfInfo* xfi, UINT32 windowId, UINT16 command)
syscommand.windowId = windowId;
syscommand.command = command;
- xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND, &syscommand);
+ xf_send_rail_client_event(channels, RailChannel_ClientSystemCommand, &syscommand);
}
/**
* send an update to the RDP server informing it of the new window position
* and size.
*/
-void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window)
+void xf_rail_adjust_position(xfInfo* xfi, rdpWindow* window)
{
xfWindow* xfw;
rdpChannels* channels;
window->windowOffsetX, window->windowOffsetY,
window->windowWidth, window->windowHeight);
- xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &window_move);
+ xf_send_rail_client_event(channels, RailChannel_ClientWindowMove, &window_move);
}
}
window_move.right = window_move.left + xfw->width; /* In the update to RDP the position is one past the window */
window_move.bottom = window_move.top + xfw->height;
- xf_send_rail_client_event(channels,
- RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &window_move);
+ xf_send_rail_client_event(channels, RailChannel_ClientWindowMove, &window_move);
/*
* Simulate button up at new position to end the local move (per RDP spec)
sysparam->dragFullWindows = FALSE;
- xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS, sysparam);
+ xf_send_rail_client_event(channels, RailChannel_ClientSystemParam, sysparam);
}
const char* error_code_names[] =
void xf_process_rail_event(xfInfo* xfi, rdpChannels* channels, RDP_EVENT* event)
{
- switch (event->event_type)
+ switch (GetMessageType(event->id))
{
- case RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS:
+ case RailChannel_GetSystemParam:
xf_process_rail_get_sysparams_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS:
+ case RailChannel_ServerExecuteResult:
xf_process_rail_exec_result_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM:
+ case RailChannel_ServerSystemParam:
xf_process_rail_server_sysparam_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_MINMAXINFO:
+ case RailChannel_ServerMinMaxInfo:
xf_process_rail_server_minmaxinfo_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE:
+ case RailChannel_ServerLocalMoveSize:
xf_process_rail_server_localmovesize_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP:
+ case RailChannel_ServerGetAppIdResponse:
xf_process_rail_appid_resp_event(xfi, channels, event);
break;
- case RDP_EVENT_TYPE_RAIL_CHANNEL_LANGBARINFO:
+ case RailChannel_ServerLanguageBarInfo:
xf_process_rail_langbarinfo_event(xfi, channels, event);
break;
#define RailChannel_ClientExecute 1
#define RailChannel_ClientActivate 2
-#define RailChannel_ClientSystemParameters 3
-#define RailChannel_ClientSystemCommand 4
-#define RailChannel_ClientHandshake 5
-#define RailChannel_ServerHandshake 6
-#define RailChannel_ClientNotifyEvent 7
-#define RailChannel_ClientWindowMove 8
-#define RailChannel_ServerLocalMoveSize 9
-#define RailChannel_ServerMinMaxInfo 10
-#define RailChannel_ClientInformation 11
-#define RailChannel_ClientSystemMenu 12
-#define RailChannel_ClientLanguageBarInfo 13
-#define RailChannel_ServerLanguageBarInfo 14
-#define RailChannel_ServerExecuteResult 15
-#define RailChannel_ClientGetAppIdRequest 16
-#define RailChannel_ServerGetAppIdResponse 17
+#define RailChannel_GetSystemParam 3
+#define RailChannel_ClientSystemParam 4
+#define RailChannel_ServerSystemParam 5
+#define RailChannel_ClientSystemCommand 6
+#define RailChannel_ClientHandshake 7
+#define RailChannel_ServerHandshake 8
+#define RailChannel_ClientNotifyEvent 9
+#define RailChannel_ClientWindowMove 10
+#define RailChannel_ServerLocalMoveSize 11
+#define RailChannel_ServerMinMaxInfo 12
+#define RailChannel_ClientInformation 13
+#define RailChannel_ClientSystemMenu 14
+#define RailChannel_ClientLanguageBarInfo 15
+#define RailChannel_ServerLanguageBarInfo 16
+#define RailChannel_ServerExecuteResult 17
+#define RailChannel_ClientGetAppIdRequest 18
+#define RailChannel_ServerGetAppIdResponse 19
#define FREERDP_RAIL_CHANNEL_CLIENT_EXECUTE MakeMessageId(RailChannel, ClientExecute)
#define FREERDP_RAIL_CHANNEL_CLIENT_ACTIVATE MakeMessageId(RailChannel, ClientActivate)
-#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_PARAMETERS MakeMessageId(RailChannel, ClientSystemParameters)
+#define FREERDP_RAIL_CHANNEL_GET_SYSTEM_PARAM MakeMessageId(RailChannel, GetSystemParam)
+#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam)
+#define FREERDP_RAIL_CHANNEL_SERVER_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam)
#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_COMMAND MakeMessageId(RailChannel, ClientSystemCommand)
#define FREERDP_RAIL_CHANNEL_CLIENT_HANDSHAKE MakeMessageId(RailChannel, ClientHandshake)
#define FREERDP_RAIL_CHANNEL_SERVER_HANDSHAKE MakeMessageId(RailChannel, ServerHandshake)
RDP_RAIL_ORDER_GET_APPID_RESP = 0x000F
};
-enum RDP_EVENT_TYPE_RAIL
-{
- RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS = 1,
- RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_MINMAXINFO,
- RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE,
- RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP,
- 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,
- RDP_EVENT_TYPE_RAIL_CLIENT_NOTIFY_EVENT,
- RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE,
- RDP_EVENT_TYPE_RAIL_CLIENT_APPID_REQ,
- RDP_EVENT_TYPE_RAIL_CLIENT_LANGBARINFO
-};
-
#endif /* FREERDP_RAIL_GLOBAL_H */
struct _RDP_EVENT
{
UINT32 id;
- UINT16 event_class;
- UINT16 event_type;
RDP_EVENT_CALLBACK on_event_free_callback;
void* user_data;
};
if (event)
{
- event->event_class = event_class;
- event->event_type = event_type;
event->on_event_free_callback = on_event_free_callback;
event->user_data = user_data;
BOOL rail_read_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
+
stream_read_UINT16(s, unicode_string->length); /* cbString (2 bytes) */
- if(stream_get_left(s) < unicode_string->length)
+
+ if (stream_get_left(s) < unicode_string->length)
return FALSE;
if (unicode_string->string == NULL)
unicode_string->string = (BYTE*) realloc(unicode_string->string, unicode_string->length);
stream_read(s, unicode_string->string, unicode_string->length);
+
return TRUE;
}
UINT32 size;
} ordersize_table[] =
{
- {RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS, sizeof(RAIL_SYSPARAM_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS, sizeof(RAIL_EXEC_RESULT_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM, sizeof(RAIL_SYSPARAM_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_MINMAXINFO, sizeof(RAIL_MINMAXINFO_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE, sizeof(RAIL_LOCALMOVESIZE_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP, sizeof(RAIL_GET_APPID_RESP_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CHANNEL_LANGBARINFO, sizeof(RAIL_LANGBAR_INFO_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS, sizeof(RAIL_SYSPARAM_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP, sizeof(RDP_PLUGIN_DATA)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE, sizeof(RAIL_ACTIVATE_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_SYSMENU, sizeof(RAIL_SYSMENU_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND, sizeof(RAIL_SYSCOMMAND_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_NOTIFY_EVENT, sizeof(RAIL_NOTIFY_EVENT_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, sizeof(RAIL_WINDOW_MOVE_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_APPID_REQ, sizeof(RAIL_GET_APPID_REQ_ORDER)},
- {RDP_EVENT_TYPE_RAIL_CLIENT_LANGBARINFO, sizeof(RAIL_LANGBAR_INFO_ORDER)},
+ {RailChannel_GetSystemParam, sizeof(RAIL_SYSPARAM_ORDER)},
+ {RailChannel_ServerExecuteResult, sizeof(RAIL_EXEC_RESULT_ORDER)},
+ {RailChannel_ServerSystemParam, sizeof(RAIL_SYSPARAM_ORDER)},
+ {RailChannel_ServerMinMaxInfo, sizeof(RAIL_MINMAXINFO_ORDER)},
+ {RailChannel_ServerLocalMoveSize, sizeof(RAIL_LOCALMOVESIZE_ORDER)},
+ {RailChannel_ServerGetAppIdResponse, sizeof(RAIL_GET_APPID_RESP_ORDER)},
+ {RailChannel_ServerLanguageBarInfo, sizeof(RAIL_LANGBAR_INFO_ORDER)},
+ {RailChannel_ClientSystemParam, sizeof(RAIL_SYSPARAM_ORDER)},
+ {RailChannel_ClientExecute, sizeof(RDP_PLUGIN_DATA)},
+ {RailChannel_ClientActivate, sizeof(RAIL_ACTIVATE_ORDER)},
+ {RailChannel_ClientSystemMenu, sizeof(RAIL_SYSMENU_ORDER)},
+ {RailChannel_ClientSystemCommand, sizeof(RAIL_SYSCOMMAND_ORDER)},
+ {RailChannel_ClientNotifyEvent, sizeof(RAIL_NOTIFY_EVENT_ORDER)},
+ {RailChannel_ClientWindowMove, sizeof(RAIL_WINDOW_MOVE_ORDER)},
+ {RailChannel_ClientGetAppIdRequest, sizeof(RAIL_GET_APPID_REQ_ORDER)},
+ {RailChannel_ClientLanguageBarInfo, sizeof(RAIL_LANGBAR_INFO_ORDER)},
};
size_t i = 0;
size_t order_size = 0;
}
// Event type not found.
- if (order_size == 0) return NULL;
+ if (order_size == 0)
+ return NULL;
new_order = malloc(order_size);
- memcpy(new_order, order, order_size);
+ CopyMemory(new_order, order, order_size);
//printf("rail_clone_order: type=%d order=%p\n", event_type, new_order);
// Create copy of variable data for some orders
- if ((event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS) ||
- (event_type == RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS))
+ if ((event_type == RailChannel_GetSystemParam) ||
+ (event_type == RailChannel_ClientSystemParam))
{
- RAIL_SYSPARAM_ORDER* new_sysparam = (RAIL_SYSPARAM_ORDER*)new_order;
- RAIL_SYSPARAM_ORDER* old_sysparam = (RAIL_SYSPARAM_ORDER*)order;
+ RAIL_SYSPARAM_ORDER* new_sysparam = (RAIL_SYSPARAM_ORDER*) new_order;
+ RAIL_SYSPARAM_ORDER* old_sysparam = (RAIL_SYSPARAM_ORDER*) order;
rail_unicode_string_alloc(&new_sysparam->highContrast.colorScheme,
old_sysparam->highContrast.colorScheme.length);
- memcpy(new_sysparam->highContrast.colorScheme.string,
+ CopyMemory(new_sysparam->highContrast.colorScheme.string,
old_sysparam->highContrast.colorScheme.string,
old_sysparam->highContrast.colorScheme.length);
}
- if (event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS)
+ if (event_type == RailChannel_ServerExecuteResult)
{
- RAIL_EXEC_RESULT_ORDER* new_exec_result = (RAIL_EXEC_RESULT_ORDER*)new_order;
- RAIL_EXEC_RESULT_ORDER* old_exec_result = (RAIL_EXEC_RESULT_ORDER*)order;
+ RAIL_EXEC_RESULT_ORDER* new_exec_result = (RAIL_EXEC_RESULT_ORDER*) new_order;
+ RAIL_EXEC_RESULT_ORDER* old_exec_result = (RAIL_EXEC_RESULT_ORDER*) order;
rail_unicode_string_alloc(&new_exec_result->exeOrFile,
old_exec_result->exeOrFile.length);
- memcpy(new_exec_result->exeOrFile.string,
+ CopyMemory(new_exec_result->exeOrFile.string,
old_exec_result->exeOrFile.string,
old_exec_result->exeOrFile.length);
}
- if (event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP)
+ if (event_type == RailChannel_ServerGetAppIdResponse)
{
RAIL_GET_APPID_RESP_ORDER* new_app_resp = (RAIL_GET_APPID_RESP_ORDER*)new_order;
void rail_free_cloned_order(UINT32 event_type, void* order)
{
//printf("rail_free_cloned_order: type=%d order=%p\n", event_type, order);
- if ((event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS) ||
- (event_type == RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS))
+ if ((event_type == RailChannel_GetSystemParam) ||
+ (event_type == RailChannel_ClientSystemParam))
{
- RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*)order;
+ RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*) order;
rail_unicode_string_free(&sysparam->highContrast.colorScheme);
}
- if (event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS)
+ if (event_type == RailChannel_ServerExecuteResult)
{
- RAIL_EXEC_RESULT_ORDER* exec_result = (RAIL_EXEC_RESULT_ORDER*)order;
+ RAIL_EXEC_RESULT_ORDER* exec_result = (RAIL_EXEC_RESULT_ORDER*) order;
rail_unicode_string_free(&exec_result->exeOrFile);
}
+
free(order);
}