libfreerdp-rail: cleanup RAIL code

This commit is contained in:
Marc-André Moreau 2013-10-09 22:38:26 -04:00
parent 3d7d4c50db
commit 7a7c967425
6 changed files with 226 additions and 196 deletions

View File

@ -31,9 +31,7 @@
#include "rail_orders.h"
void rail_send_pdu(rdpRailOrder* rail_order, wStream* s, UINT16 orderType)
void rail_send_pdu(rdpRailOrder* railOrder, wStream* s, UINT16 orderType)
{
UINT16 orderLength;
@ -47,26 +45,28 @@ void rail_send_pdu(rdpRailOrder* rail_order, wStream* s, UINT16 orderType)
DEBUG_RAIL("Sending %s PDU, length:%d",
RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength);
rail_send_channel_data(rail_order->plugin, Stream_Buffer(s), orderLength);
rail_send_channel_data(railOrder->plugin, Stream_Buffer(s), orderLength);
}
void rail_write_high_contrast(wStream* s, RAIL_HIGH_CONTRAST* high_contrast)
void rail_write_high_contrast(wStream* s, RAIL_HIGH_CONTRAST* highContrast)
{
high_contrast->colorSchemeLength = high_contrast->colorScheme.length + 2;
Stream_Write_UINT32(s, high_contrast->flags); /* flags (4 bytes) */
Stream_Write_UINT32(s, high_contrast->colorSchemeLength); /* colorSchemeLength (4 bytes) */
rail_write_unicode_string(s, &high_contrast->colorScheme); /* colorScheme */
highContrast->colorSchemeLength = highContrast->colorScheme.length + 2;
Stream_Write_UINT32(s, highContrast->flags); /* flags (4 bytes) */
Stream_Write_UINT32(s, highContrast->colorSchemeLength); /* colorSchemeLength (4 bytes) */
rail_write_unicode_string(s, &highContrast->colorScheme); /* colorScheme */
}
BOOL rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* exec_result)
BOOL rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* execResult)
{
if (Stream_GetRemainingLength(s) < 8)
return FALSE;
Stream_Read_UINT16(s, exec_result->flags); /* flags (2 bytes) */
Stream_Read_UINT16(s, exec_result->execResult); /* execResult (2 bytes) */
Stream_Read_UINT32(s, exec_result->rawResult); /* rawResult (4 bytes) */
Stream_Read_UINT16(s, execResult->flags); /* flags (2 bytes) */
Stream_Read_UINT16(s, execResult->execResult); /* execResult (2 bytes) */
Stream_Read_UINT32(s, execResult->rawResult); /* rawResult (4 bytes) */
Stream_Seek_UINT16(s); /* padding (2 bytes) */
return rail_read_unicode_string(s, &exec_result->exeOrFile); /* exeOrFile */
return rail_read_unicode_string(s, &execResult->exeOrFile); /* exeOrFile */
}
BOOL rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam)
@ -75,6 +75,7 @@ BOOL rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam)
if (Stream_GetRemainingLength(s) < 5)
return FALSE;
Stream_Read_UINT32(s, sysparam->param); /* systemParam (4 bytes) */
Stream_Read_UINT8(s, body); /* body (1 byte) */
@ -91,6 +92,7 @@ BOOL rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam)
default:
break;
}
return TRUE;
}
@ -98,6 +100,7 @@ BOOL rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmax
{
if (Stream_GetRemainingLength(s) < 20)
return FALSE;
Stream_Read_UINT32(s, minmaxinfo->windowId); /* windowId (4 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */
@ -107,49 +110,57 @@ BOOL rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmax
Stream_Read_UINT16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */
return TRUE;
}
BOOL rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize)
BOOL rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localMoveSize)
{
UINT16 isMoveSizeStart;
if (Stream_GetRemainingLength(s) < 12)
return FALSE;
Stream_Read_UINT32(s, localmovesize->windowId); /* windowId (4 bytes) */
Stream_Read_UINT32(s, localMoveSize->windowId); /* windowId (4 bytes) */
Stream_Read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
localmovesize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE;
localMoveSize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE;
Stream_Read_UINT16(s, localMoveSize->moveSizeType); /* moveSizeType (2 bytes) */
Stream_Read_UINT16(s, localMoveSize->posX); /* posX (2 bytes) */
Stream_Read_UINT16(s, localMoveSize->posY); /* posY (2 bytes) */
Stream_Read_UINT16(s, localmovesize->moveSizeType); /* moveSizeType (2 bytes) */
Stream_Read_UINT16(s, localmovesize->posX); /* posX (2 bytes) */
Stream_Read_UINT16(s, localmovesize->posY); /* posY (2 bytes) */
return TRUE;
}
BOOL rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp)
BOOL rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* getAppidResp)
{
if (Stream_GetRemainingLength(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) */
get_appid_resp->applicationId.length = 512;
get_appid_resp->applicationId.string = &get_appid_resp->applicationIdBuffer[0];
Stream_Read_UINT32(s, getAppidResp->windowId); /* windowId (4 bytes) */
Stream_Read(s, &getAppidResp->applicationIdBuffer[0], 512); /* applicationId (256 UNICODE chars) */
getAppidResp->applicationId.length = 512;
getAppidResp->applicationId.string = &getAppidResp->applicationIdBuffer[0];
return TRUE;
}
BOOL rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info)
BOOL rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbarInfo)
{
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
Stream_Read_UINT32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
Stream_Read_UINT32(s, langbarInfo->languageBarStatus); /* languageBarStatus (4 bytes) */
return TRUE;
}
void rail_write_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* client_status)
void rail_write_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* clientStatus)
{
Stream_Write_UINT32(s, client_status->flags); /* flags (4 bytes) */
Stream_Write_UINT32(s, clientStatus->flags); /* flags (4 bytes) */
}
void rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec)
@ -166,6 +177,7 @@ void rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec)
void rail_write_client_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam)
{
BYTE body;
Stream_Write_UINT32(s, sysparam->param); /* systemParam (4 bytes) */
switch (sysparam->param)
@ -240,143 +252,143 @@ void rail_write_client_syscommand_order(wStream* s, RAIL_SYSCOMMAND_ORDER* sysco
Stream_Write_UINT16(s, syscommand->command); /* command (2 bytes) */
}
void rail_write_client_notify_event_order(wStream* s, RAIL_NOTIFY_EVENT_ORDER* notify_event)
void rail_write_client_notify_event_order(wStream* s, RAIL_NOTIFY_EVENT_ORDER* notifyEvent)
{
Stream_Write_UINT32(s, notify_event->windowId); /* windowId (4 bytes) */
Stream_Write_UINT32(s, notify_event->notifyIconId); /* notifyIconId (4 bytes) */
Stream_Write_UINT32(s, notify_event->message); /* notifyIconId (4 bytes) */
Stream_Write_UINT32(s, notifyEvent->windowId); /* windowId (4 bytes) */
Stream_Write_UINT32(s, notifyEvent->notifyIconId); /* notifyIconId (4 bytes) */
Stream_Write_UINT32(s, notifyEvent->message); /* notifyIconId (4 bytes) */
}
void rail_write_client_window_move_order(wStream* s, RAIL_WINDOW_MOVE_ORDER* window_move)
void rail_write_client_window_move_order(wStream* s, RAIL_WINDOW_MOVE_ORDER* windowMove)
{
Stream_Write_UINT32(s, window_move->windowId); /* windowId (4 bytes) */
Stream_Write_UINT16(s, window_move->left); /* left (2 bytes) */
Stream_Write_UINT16(s, window_move->top); /* top (2 bytes) */
Stream_Write_UINT16(s, window_move->right); /* right (2 bytes) */
Stream_Write_UINT16(s, window_move->bottom); /* bottom (2 bytes) */
Stream_Write_UINT32(s, windowMove->windowId); /* windowId (4 bytes) */
Stream_Write_UINT16(s, windowMove->left); /* left (2 bytes) */
Stream_Write_UINT16(s, windowMove->top); /* top (2 bytes) */
Stream_Write_UINT16(s, windowMove->right); /* right (2 bytes) */
Stream_Write_UINT16(s, windowMove->bottom); /* bottom (2 bytes) */
}
void rail_write_client_get_appid_req_order(wStream* s, RAIL_GET_APPID_REQ_ORDER* get_appid_req)
void rail_write_client_get_appid_req_order(wStream* s, RAIL_GET_APPID_REQ_ORDER* getAppidReq)
{
Stream_Write_UINT32(s, get_appid_req->windowId); /* windowId (4 bytes) */
Stream_Write_UINT32(s, getAppidReq->windowId); /* windowId (4 bytes) */
}
void rail_write_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info)
void rail_write_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbarInfo)
{
Stream_Write_UINT32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
Stream_Write_UINT32(s, langbarInfo->languageBarStatus); /* languageBarStatus (4 bytes) */
}
BOOL rail_recv_handshake_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_handshake_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_handshake_order(s, &rail_order->handshake))
if (!rail_read_handshake_order(s, &railOrder->handshake))
return FALSE;
rail_order->handshake.buildNumber = 0x00001DB0;
rail_send_handshake_order(rail_order);
railOrder->handshake.buildNumber = 0x00001DB0;
rail_send_handshake_order(railOrder);
rail_order->client_status.flags = RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE;
rail_send_client_status_order(rail_order);
railOrder->client_status.flags = RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE;
rail_send_client_status_order(railOrder);
/* sysparam update */
rail_order->sysparam.params = 0;
railOrder->sysparam.params = 0;
rail_order->sysparam.params |= SPI_MASK_SET_HIGH_CONTRAST;
rail_order->sysparam.highContrast.colorScheme.string = NULL;
rail_order->sysparam.highContrast.colorScheme.length = 0;
rail_order->sysparam.highContrast.flags = 0x7E;
railOrder->sysparam.params |= SPI_MASK_SET_HIGH_CONTRAST;
railOrder->sysparam.highContrast.colorScheme.string = NULL;
railOrder->sysparam.highContrast.colorScheme.length = 0;
railOrder->sysparam.highContrast.flags = 0x7E;
rail_order->sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
rail_order->sysparam.mouseButtonSwap = FALSE;
railOrder->sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
railOrder->sysparam.mouseButtonSwap = FALSE;
rail_order->sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
rail_order->sysparam.keyboardPref = FALSE;
railOrder->sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
railOrder->sysparam.keyboardPref = FALSE;
rail_order->sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
rail_order->sysparam.dragFullWindows = FALSE;
railOrder->sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
railOrder->sysparam.dragFullWindows = FALSE;
rail_order->sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
rail_order->sysparam.keyboardCues = FALSE;
railOrder->sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
railOrder->sysparam.keyboardCues = FALSE;
rail_order->sysparam.params |= SPI_MASK_SET_WORK_AREA;
rail_order->sysparam.workArea.left = 0;
rail_order->sysparam.workArea.top = 0;
rail_order->sysparam.workArea.right = 1024;
rail_order->sysparam.workArea.bottom = 768;
railOrder->sysparam.params |= SPI_MASK_SET_WORK_AREA;
railOrder->sysparam.workArea.left = 0;
railOrder->sysparam.workArea.top = 0;
railOrder->sysparam.workArea.right = 1024;
railOrder->sysparam.workArea.bottom = 768;
rail_send_channel_event(rail_order->plugin,
RailChannel_GetSystemParam, &rail_order->sysparam);
rail_send_channel_event(railOrder->plugin,
RailChannel_GetSystemParam, &railOrder->sysparam);
return TRUE;
}
BOOL rail_recv_exec_result_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_exec_result_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_server_exec_result_order(s, &rail_order->exec_result))
if (!rail_read_server_exec_result_order(s, &railOrder->exec_result))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerExecuteResult, &rail_order->exec_result);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerExecuteResult, &railOrder->exec_result);
return TRUE;
}
BOOL rail_recv_server_sysparam_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_server_sysparam_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_server_sysparam_order(s, &rail_order->sysparam))
if (!rail_read_server_sysparam_order(s, &railOrder->sysparam))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerSystemParam, &rail_order->sysparam);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerSystemParam, &railOrder->sysparam);
return TRUE;
}
BOOL rail_recv_server_minmaxinfo_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_server_minmaxinfo_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_server_minmaxinfo_order(s, &rail_order->minmaxinfo))
if (!rail_read_server_minmaxinfo_order(s, &railOrder->minmaxinfo))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerMinMaxInfo, &rail_order->minmaxinfo);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerMinMaxInfo, &railOrder->minmaxinfo);
return TRUE;
}
BOOL rail_recv_server_localmovesize_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_server_localmovesize_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_server_localmovesize_order(s, &rail_order->localmovesize))
if (!rail_read_server_localmovesize_order(s, &railOrder->localmovesize))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerLocalMoveSize, &rail_order->localmovesize);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerLocalMoveSize, &railOrder->localmovesize);
return TRUE;
}
BOOL rail_recv_server_get_appid_resp_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_server_get_appid_resp_order(rdpRailOrder* railOrder, 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, &railOrder->get_appid_resp))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerGetAppIdResponse, &rail_order->get_appid_resp);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerGetAppIdResponse, &railOrder->get_appid_resp);
return TRUE;
}
BOOL rail_recv_langbar_info_order(rdpRailOrder* rail_order, wStream* s)
BOOL rail_recv_langbar_info_order(rdpRailOrder* railOrder, wStream* s)
{
if (!rail_read_langbar_info_order(s, &rail_order->langbar_info))
if (!rail_read_langbar_info_order(s, &railOrder->langbar_info))
return FALSE;
rail_send_channel_event(rail_order->plugin,
RailChannel_ServerLanguageBarInfo, &rail_order->langbar_info);
rail_send_channel_event(railOrder->plugin,
RailChannel_ServerLanguageBarInfo, &railOrder->langbar_info);
return TRUE;
}
BOOL rail_order_recv(rdpRailOrder* rail_order, wStream* s)
BOOL rail_order_recv(rdpRailOrder* railOrder, wStream* s)
{
UINT16 orderType;
UINT16 orderLength;
@ -390,75 +402,76 @@ BOOL rail_order_recv(rdpRailOrder* rail_order, wStream* s)
switch (orderType)
{
case RDP_RAIL_ORDER_HANDSHAKE:
return rail_recv_handshake_order(rail_order, s);
return rail_recv_handshake_order(railOrder, s);
case RDP_RAIL_ORDER_EXEC_RESULT:
return rail_recv_exec_result_order(rail_order, s);
return rail_recv_exec_result_order(railOrder, s);
case RDP_RAIL_ORDER_SYSPARAM:
return rail_recv_server_sysparam_order(rail_order, s);
return rail_recv_server_sysparam_order(railOrder, s);
case RDP_RAIL_ORDER_MINMAXINFO:
return rail_recv_server_minmaxinfo_order(rail_order, s);
return rail_recv_server_minmaxinfo_order(railOrder, s);
case RDP_RAIL_ORDER_LOCALMOVESIZE:
return rail_recv_server_localmovesize_order(rail_order, s);
return rail_recv_server_localmovesize_order(railOrder, s);
case RDP_RAIL_ORDER_GET_APPID_RESP:
return rail_recv_server_get_appid_resp_order(rail_order, s);
return rail_recv_server_get_appid_resp_order(railOrder, s);
case RDP_RAIL_ORDER_LANGBARINFO:
return rail_recv_langbar_info_order(rail_order, s);
return rail_recv_langbar_info_order(railOrder, s);
default:
fprintf(stderr, "Unknown RAIL PDU order reveived.");
break;
}
return TRUE;
}
void rail_send_handshake_order(rdpRailOrder* rail_order)
void rail_send_handshake_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_HANDSHAKE_ORDER_LENGTH);
rail_write_handshake_order(s, &rail_order->handshake);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_HANDSHAKE);
rail_write_handshake_order(s, &railOrder->handshake);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_HANDSHAKE);
Stream_Free(s, TRUE);
}
void rail_send_client_status_order(rdpRailOrder* rail_order)
void rail_send_client_status_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_CLIENT_STATUS_ORDER_LENGTH);
rail_write_client_status_order(s, &rail_order->client_status);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_CLIENTSTATUS);
rail_write_client_status_order(s, &railOrder->client_status);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_CLIENTSTATUS);
Stream_Free(s, TRUE);
}
void rail_send_client_exec_order(rdpRailOrder* rail_order)
void rail_send_client_exec_order(rdpRailOrder* railOrder)
{
wStream* s;
int length;
length = RAIL_EXEC_ORDER_LENGTH +
rail_order->exec.exeOrFile.length +
rail_order->exec.workingDir.length +
rail_order->exec.arguments.length;
railOrder->exec.exeOrFile.length +
railOrder->exec.workingDir.length +
railOrder->exec.arguments.length;
s = rail_pdu_init(RAIL_EXEC_ORDER_LENGTH);
rail_write_client_exec_order(s, &rail_order->exec);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_EXEC);
rail_write_client_exec_order(s, &railOrder->exec);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_EXEC);
Stream_Free(s, TRUE);
}
void rail_send_client_sysparam_order(rdpRailOrder* rail_order)
void rail_send_client_sysparam_order(rdpRailOrder* railOrder)
{
wStream* s;
int length;
length = RAIL_SYSPARAM_ORDER_LENGTH;
switch (rail_order->sysparam.param)
switch (railOrder->sysparam.param)
{
case SPI_SET_DRAG_FULL_WINDOWS:
case SPI_SET_KEYBOARD_CUES:
@ -474,139 +487,142 @@ void rail_send_client_sysparam_order(rdpRailOrder* rail_order)
break;
case SPI_SET_HIGH_CONTRAST:
length += rail_order->sysparam.highContrast.colorSchemeLength + 10;
length += railOrder->sysparam.highContrast.colorSchemeLength + 10;
break;
}
s = rail_pdu_init(RAIL_SYSPARAM_ORDER_LENGTH + 8);
rail_write_client_sysparam_order(s, &rail_order->sysparam);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_SYSPARAM);
rail_write_client_sysparam_order(s, &railOrder->sysparam);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_SYSPARAM);
Stream_Free(s, TRUE);
}
void rail_send_client_sysparams_order(rdpRailOrder* rail_order)
void rail_send_client_sysparams_order(rdpRailOrder* railOrder)
{
if (rail_order->sysparam.params & SPI_MASK_SET_HIGH_CONTRAST)
if (railOrder->sysparam.params & SPI_MASK_SET_HIGH_CONTRAST)
{
rail_order->sysparam.param = SPI_SET_HIGH_CONTRAST;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_HIGH_CONTRAST;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_TASKBAR_POS)
if (railOrder->sysparam.params & SPI_MASK_TASKBAR_POS)
{
rail_order->sysparam.param = SPI_TASKBAR_POS;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_TASKBAR_POS;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_SET_MOUSE_BUTTON_SWAP)
if (railOrder->sysparam.params & SPI_MASK_SET_MOUSE_BUTTON_SWAP)
{
rail_order->sysparam.param = SPI_SET_MOUSE_BUTTON_SWAP;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_MOUSE_BUTTON_SWAP;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_SET_KEYBOARD_PREF)
if (railOrder->sysparam.params & SPI_MASK_SET_KEYBOARD_PREF)
{
rail_order->sysparam.param = SPI_SET_KEYBOARD_PREF;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_KEYBOARD_PREF;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_SET_DRAG_FULL_WINDOWS)
if (railOrder->sysparam.params & SPI_MASK_SET_DRAG_FULL_WINDOWS)
{
rail_order->sysparam.param = SPI_SET_DRAG_FULL_WINDOWS;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_DRAG_FULL_WINDOWS;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_SET_KEYBOARD_CUES)
if (railOrder->sysparam.params & SPI_MASK_SET_KEYBOARD_CUES)
{
rail_order->sysparam.param = SPI_SET_KEYBOARD_CUES;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_KEYBOARD_CUES;
rail_send_client_sysparam_order(railOrder);
}
if (rail_order->sysparam.params & SPI_MASK_SET_WORK_AREA)
if (railOrder->sysparam.params & SPI_MASK_SET_WORK_AREA)
{
rail_order->sysparam.param = SPI_SET_WORK_AREA;
rail_send_client_sysparam_order(rail_order);
railOrder->sysparam.param = SPI_SET_WORK_AREA;
rail_send_client_sysparam_order(railOrder);
}
}
void rail_send_client_activate_order(rdpRailOrder* rail_order)
void rail_send_client_activate_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_ACTIVATE_ORDER_LENGTH);
rail_write_client_activate_order(s, &rail_order->activate);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_ACTIVATE);
rail_write_client_activate_order(s, &railOrder->activate);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_ACTIVATE);
Stream_Free(s, TRUE);
}
void rail_send_client_sysmenu_order(rdpRailOrder* rail_order)
void rail_send_client_sysmenu_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_SYSMENU_ORDER_LENGTH);
rail_write_client_sysmenu_order(s, &rail_order->sysmenu);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_SYSMENU);
rail_write_client_sysmenu_order(s, &railOrder->sysmenu);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_SYSMENU);
Stream_Free(s, TRUE);
}
void rail_send_client_syscommand_order(rdpRailOrder* rail_order)
void rail_send_client_syscommand_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_SYSCOMMAND_ORDER_LENGTH);
rail_write_client_syscommand_order(s, &rail_order->syscommand);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_SYSCOMMAND);
rail_write_client_syscommand_order(s, &railOrder->syscommand);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_SYSCOMMAND);
Stream_Free(s, TRUE);
}
void rail_send_client_notify_event_order(rdpRailOrder* rail_order)
void rail_send_client_notify_event_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_NOTIFY_EVENT_ORDER_LENGTH);
rail_write_client_notify_event_order(s, &rail_order->notify_event);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_NOTIFY_EVENT);
rail_write_client_notify_event_order(s, &railOrder->notify_event);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_NOTIFY_EVENT);
Stream_Free(s, TRUE);
}
void rail_send_client_window_move_order(rdpRailOrder* rail_order)
void rail_send_client_window_move_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_WINDOW_MOVE_ORDER_LENGTH);
rail_write_client_window_move_order(s, &rail_order->window_move);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_WINDOWMOVE);
rail_write_client_window_move_order(s, &railOrder->window_move);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_WINDOWMOVE);
Stream_Free(s, TRUE);
}
void rail_send_client_get_appid_req_order(rdpRailOrder* rail_order)
void rail_send_client_get_appid_req_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_GET_APPID_REQ_ORDER_LENGTH);
rail_write_client_get_appid_req_order(s, &rail_order->get_appid_req);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_GET_APPID_REQ);
rail_write_client_get_appid_req_order(s, &railOrder->get_appid_req);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_GET_APPID_REQ);
Stream_Free(s, TRUE);
}
void rail_send_client_langbar_info_order(rdpRailOrder* rail_order)
void rail_send_client_langbar_info_order(rdpRailOrder* railOrder)
{
wStream* s;
s = rail_pdu_init(RAIL_LANGBAR_INFO_ORDER_LENGTH);
rail_write_langbar_info_order(s, &rail_order->langbar_info);
rail_send_pdu(rail_order, s, RDP_RAIL_ORDER_LANGBARINFO);
rail_write_langbar_info_order(s, &railOrder->langbar_info);
rail_send_pdu(railOrder, s, RDP_RAIL_ORDER_LANGBARINFO);
Stream_Free(s, TRUE);
}
rdpRailOrder* rail_order_new()
{
rdpRailOrder* rail_order;
rdpRailOrder* railOrder;
rail_order = (rdpRailOrder*) malloc(sizeof(rdpRailOrder));
ZeroMemory(rail_order, sizeof(rdpRailOrder));
return rail_order;
railOrder = (rdpRailOrder*) malloc(sizeof(rdpRailOrder));
if (railOrder)
{
ZeroMemory(railOrder, sizeof(rdpRailOrder));
}
return railOrder;
}
void rail_order_free(rdpRailOrder* rail_order)
void rail_order_free(rdpRailOrder* railOrder)
{
if (rail_order != NULL)
if (railOrder)
{
free(rail_order);
free(railOrder);
}
}

View File

@ -532,6 +532,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
#define FreeRDP_PasswordIsSmartcardPin 717
#define FreeRDP_UsingSavedCredentials 718
#define FreeRDP_ForceEncryptedCsPdu 719
#define FreeRDP_HiDefRemoteApp 720
#define FreeRDP_IPv6Enabled 768
#define FreeRDP_ClientAddress 769
#define FreeRDP_ClientDir 770
@ -857,7 +858,8 @@ struct rdp_settings
ALIGN64 BOOL PasswordIsSmartcardPin; /* 717 */
ALIGN64 BOOL UsingSavedCredentials; /* 718 */
ALIGN64 BOOL ForceEncryptedCsPdu; /* 719 */
UINT64 padding0768[768 - 720]; /* 720 */
ALIGN64 BOOL HiDefRemoteApp; /* 720 */
UINT64 padding0768[768 - 721]; /* 721 */
/* Client Info (Extra) */
ALIGN64 BOOL IPv6Enabled; /* 768 */

View File

@ -460,6 +460,10 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id)
return settings->ForceEncryptedCsPdu;
break;
case FreeRDP_HiDefRemoteApp:
return settings->HiDefRemoteApp;
break;
case FreeRDP_IPv6Enabled:
return settings->IPv6Enabled;
break;
@ -919,6 +923,10 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)
settings->ForceEncryptedCsPdu = param;
break;
case FreeRDP_HiDefRemoteApp:
settings->HiDefRemoteApp = param;
break;
case FreeRDP_IPv6Enabled:
settings->IPv6Enabled = param;
break;

View File

@ -245,7 +245,7 @@ BOOL rdp_read_info_packet(wStream* s, rdpSettings* settings)
Stream_Seek_UINT32(s); /* CodePage */
Stream_Read_UINT32(s, flags); /* flags */
settings->AudioCapture = ((flags & RNS_INFO_AUDIOCAPTURE) ? TRUE : FALSE);
settings->AudioCapture = ((flags & INFO_AUDIOCAPTURE) ? TRUE : FALSE);
settings->AudioPlayback = ((flags & INFO_NOAUDIOPLAYBACK) ? FALSE : TRUE);
settings->AutoLogonEnabled = ((flags & INFO_AUTOLOGON) ? TRUE : FALSE);
settings->RemoteApplicationMode = ((flags & INFO_RAIL) ? TRUE : FALSE);
@ -345,11 +345,14 @@ void rdp_write_info_packet(wStream* s, rdpSettings* settings)
INFO_DISABLECTRLALTDEL;
if (settings->AudioCapture)
flags |= RNS_INFO_AUDIOCAPTURE;
flags |= INFO_AUDIOCAPTURE;
if (!settings->AudioPlayback)
flags |= INFO_NOAUDIOPLAYBACK;
if (settings->VideoDisable)
flags |= INFO_VIDEO_DISABLE;
if (settings->AutoLogonEnabled)
flags |= INFO_AUTOLOGON;

View File

@ -47,8 +47,8 @@
#define INFO_PASSWORD_IS_SC_PIN 0x00040000
#define INFO_NOAUDIOPLAYBACK 0x00080000
#define INFO_USING_SAVED_CREDS 0x00100000
#define RNS_INFO_AUDIOCAPTURE 0x00200000
#define RNS_INFO_VIDEO_DISABLE 0x00400000
#define INFO_AUDIOCAPTURE 0x00200000
#define INFO_VIDEO_DISABLE 0x00400000
#define INFO_CompressionTypeMask 0x00001E00
#define INFO_PACKET_COMPR_TYPE_8K 0x00000100
#define INFO_PACKET_COMPR_TYPE_64K 0x00000200

View File

@ -30,16 +30,16 @@
#include <freerdp/rail/rail.h>
#include <freerdp/rail/window_list.h>
static void rail_WindowCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
static void rail_WindowCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState)
{
rdpRail* rail = context->rail;
window_list_create(rail->list, orderInfo, window_state);
window_list_create(rail->list, orderInfo, windowState);
}
static void rail_WindowUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
static void rail_WindowUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState)
{
rdpRail* rail = context->rail;
window_list_update(rail->list, orderInfo, window_state);
window_list_update(rail->list, orderInfo, windowState);
}
static void rail_WindowDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
@ -48,13 +48,13 @@ static void rail_WindowDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
window_list_delete(rail->list, orderInfo);
}
static void rail_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* window_icon)
static void rail_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* windowIcon)
{
rdpIcon* icon;
rdpWindow* window;
rdpRail* rail = context->rail;
if (window_icon->iconInfo->cacheEntry != 0xFFFF)
if (windowIcon->iconInfo->cacheEntry != 0xFFFF)
{
/* cache icon */
}
@ -66,12 +66,12 @@ static void rail_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, W
icon = (rdpIcon*) malloc(sizeof(rdpIcon));
ZeroMemory(icon, sizeof(rdpIcon));
icon->entry = window_icon->iconInfo;
icon->entry = windowIcon->iconInfo;
icon->big = (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ICON_BIG) ? TRUE : FALSE;
DEBUG_RAIL("Window Icon: %dx%d@%dbpp cbBitsColor:%d cbBitsMask:%d cbColorTable:%d",
window_icon->iconInfo->width, window_icon->iconInfo->height, window_icon->iconInfo->bpp,
window_icon->iconInfo->cbBitsColor, window_icon->iconInfo->cbBitsMask, window_icon->iconInfo->cbColorTable);
windowIcon->iconInfo->width, windowIcon->iconInfo->height, windowIcon->iconInfo->bpp,
windowIcon->iconInfo->cbBitsColor, windowIcon->iconInfo->cbBitsMask, windowIcon->iconInfo->cbColorTable);
if (icon->big)
window->bigIcon = icon;
@ -81,17 +81,17 @@ static void rail_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, W
IFCALL(rail->rail_SetWindowIcon, rail, window, icon);
}
static void rail_WindowCachedIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* window_cached_icon)
static void rail_WindowCachedIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* windowCachedIcon)
{
}
static void rail_NotifyIconCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state)
static void rail_NotifyIconCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
}
static void rail_NotifyIconUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state)
static void rail_NotifyIconUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
}
@ -101,15 +101,18 @@ static void rail_NotifyIconDelete(rdpContext* context, WINDOW_ORDER_INFO* orderI
}
static void rail_MonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitored_desktop)
static void rail_MonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitoredDesktop)
{
}
//This is used to switch FreeRDP back to showing the full desktop under remote app mode
//to handle cases where the screen is locked, etc. The rail server informs us that it is
//no longer monitoring the desktop. Once the desktop becomes monitored again. The full desktop
//window will be automatically destroyed and we will switch back into remote app mode.
/**
* This is used to switch FreeRDP back to showing the full desktop under remote app mode
* to handle cases where the screen is locked, etc. The rail server informs us that it is
* no longer monitoring the desktop. Once the desktop becomes monitored again. The full desktop
* window will be automatically destroyed and we will switch back into remote app mode.
*/
static void rail_NonMonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
{
rdpWindow* window;
@ -122,8 +125,6 @@ static void rail_NonMonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* ord
window_list_clear(rail->list);
}
void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update)
{
rdpWindowUpdate* window = update->window;
@ -146,7 +147,7 @@ rdpRail* rail_new(rdpSettings* settings)
rail = (rdpRail*) malloc(sizeof(rdpRail));
if (rail != NULL)
if (rail)
{
ZeroMemory(rail, sizeof(rdpRail));
@ -163,7 +164,7 @@ rdpRail* rail_new(rdpSettings* settings)
void rail_free(rdpRail* rail)
{
if (rail != NULL)
if (rail)
{
icon_cache_free(rail->cache);
window_list_free(rail->list);