From 583045e2e51d0aa5c12c66bf1ae4f22b61da3bff Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Wed, 2 Oct 2019 11:32:30 +0200 Subject: [PATCH] rail: Update to latest spec version 28.0 --- channels/rail/client/rail_orders.c | 44 +++++++++++++++++------------------ include/freerdp/rail.h | 47 +++++++++++++++++++------------------- winpr/include/winpr/stream.h | 6 +++++ 3 files changed, 52 insertions(+), 45 deletions(-) diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index da92707..72fd99e 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -211,14 +211,14 @@ static UINT rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* } 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) */ - Stream_Read_UINT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */ - Stream_Read_UINT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */ - Stream_Read_UINT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */ - 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) */ + Stream_Read_INT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */ return CHANNEL_RC_OK; } @@ -245,8 +245,8 @@ static UINT rail_read_server_localmovesize_order(wStream* s, Stream_Read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */ 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_INT16(s, localMoveSize->posX); /* posX (2 bytes) */ + Stream_Read_INT16(s, localMoveSize->posY); /* posY (2 bytes) */ return CHANNEL_RC_OK; } @@ -261,14 +261,14 @@ static UINT rail_read_server_get_appid_resp_order(wStream* s, if (!s || !getAppidResp) return ERROR_INVALID_PARAMETER; - if (Stream_GetRemainingLength(s) < 516) + if (Stream_GetRemainingLength(s) < 524) { WLog_ERR(TAG, "Stream_GetRemainingLength failed!"); return ERROR_INVALID_DATA; } Stream_Read_UINT32(s, getAppidResp->windowId); /* windowId (4 bytes) */ - Stream_Read(s, (BYTE*) & (getAppidResp->applicationId), 512); /* applicationId (256 UNICODE chars) */ + Stream_Read(s, (BYTE*) & (getAppidResp->applicationId), 520); /* applicationId (260 UNICODE chars) */ return CHANNEL_RC_OK; } @@ -472,8 +472,8 @@ static UINT rail_write_client_sysmenu_order(wStream* s, const RAIL_SYSMENU_ORDER return ERROR_INVALID_PARAMETER; Stream_Write_UINT32(s, sysmenu->windowId); /* windowId (4 bytes) */ - Stream_Write_UINT16(s, sysmenu->left); /* left (2 bytes) */ - Stream_Write_UINT16(s, sysmenu->top); /* top (2 bytes) */ + Stream_Write_INT16(s, sysmenu->left); /* left (2 bytes) */ + Stream_Write_INT16(s, sysmenu->top); /* top (2 bytes) */ return ERROR_SUCCESS; } @@ -506,10 +506,10 @@ static UINT rail_write_client_window_move_order(wStream* s, return ERROR_INVALID_PARAMETER; 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) */ + Stream_Write_INT16(s, windowMove->left); /* left (2 bytes) */ + Stream_Write_INT16(s, windowMove->top); /* top (2 bytes) */ + Stream_Write_INT16(s, windowMove->right); /* right (2 bytes) */ + Stream_Write_INT16(s, windowMove->bottom); /* bottom (2 bytes) */ return ERROR_SUCCESS; } @@ -1801,10 +1801,10 @@ UINT rail_send_client_order_snap_arrange_order(railPlugin* rail, const RAIL_SNAP } Stream_Write_UINT32(s, snap->windowId); - Stream_Write_UINT16(s, snap->left); - Stream_Write_UINT16(s, snap->top); - Stream_Write_UINT16(s, snap->right); - Stream_Write_UINT16(s, snap->bottom); + Stream_Write_INT16(s, snap->left); + Stream_Write_INT16(s, snap->top); + Stream_Write_INT16(s, snap->right); + Stream_Write_INT16(s, snap->bottom); error = rail_send_pdu(rail, s, TS_RAIL_ORDER_SNAP_ARRANGE); Stream_Free(s, TRUE); return error; diff --git a/include/freerdp/rail.h b/include/freerdp/rail.h index 3b265d5..400d00c 100644 --- a/include/freerdp/rail.h +++ b/include/freerdp/rail.h @@ -133,6 +133,7 @@ enum SPI_MASK #define TS_RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 #define TS_RAIL_CLIENTSTATUS_ZORDER_SYNC 0x00000004 #define TS_RAIL_CLIENTSTATUS_WINDOW_RESIZE_MARGIN_SUPPORTED 0x00000010 +#define TS_RAIL_CLIENTSTATUS_HIGH_DPI_ICONS_SUPPORTED 0x00000020 #define TS_RAIL_CLIENTSTATUS_APPBAR_REMOTING_SUPPORTED 0x00000040 #define TS_RAIL_CLIENTSTATUS_POWER_DISPLAY_REQUEST_SUPPORTED 0x00000080 #define TS_RAIL_CLIENTSTATUS_BIDIRECTIONAL_CLOAK_SUPPORTED 0x00000200 @@ -341,8 +342,8 @@ typedef struct _RAIL_ACTIVATE_ORDER RAIL_ACTIVATE_ORDER; struct _RAIL_SYSMENU_ORDER { UINT32 windowId; - UINT16 left; - UINT16 top; + INT16 left; + INT16 top; }; typedef struct _RAIL_SYSMENU_ORDER RAIL_SYSMENU_ORDER; @@ -364,14 +365,14 @@ typedef struct _RAIL_NOTIFY_EVENT_ORDER RAIL_NOTIFY_EVENT_ORDER; struct _RAIL_MINMAXINFO_ORDER { UINT32 windowId; - UINT16 maxWidth; - UINT16 maxHeight; - UINT16 maxPosX; - UINT16 maxPosY; - UINT16 minTrackWidth; - UINT16 minTrackHeight; - UINT16 maxTrackWidth; - UINT16 maxTrackHeight; + INT16 maxWidth; + INT16 maxHeight; + INT16 maxPosX; + INT16 maxPosY; + INT16 minTrackWidth; + INT16 minTrackHeight; + INT16 maxTrackWidth; + INT16 maxTrackHeight; }; typedef struct _RAIL_MINMAXINFO_ORDER RAIL_MINMAXINFO_ORDER; @@ -380,18 +381,18 @@ struct _RAIL_LOCALMOVESIZE_ORDER UINT32 windowId; BOOL isMoveSizeStart; UINT16 moveSizeType; - UINT16 posX; - UINT16 posY; + INT16 posX; + INT16 posY; }; typedef struct _RAIL_LOCALMOVESIZE_ORDER RAIL_LOCALMOVESIZE_ORDER; struct _RAIL_WINDOWMOVE_ORDER { UINT32 windowId; - UINT16 left; - UINT16 top; - UINT16 right; - UINT16 bottom; + INT16 left; + INT16 top; + INT16 right; + INT16 bottom; }; typedef struct _RAIL_WINDOWMOVE_ORDER RAIL_WINDOW_MOVE_ORDER; @@ -404,7 +405,7 @@ typedef struct _RAIL_GET_APPID_REQ_ORDER RAIL_GET_APPID_REQ_ORDER; struct _RAIL_GET_APPID_RESP_ORDER { UINT32 windowId; - WCHAR applicationId[256]; + WCHAR applicationId[260]; }; typedef struct _RAIL_GET_APPID_RESP_ORDER RAIL_GET_APPID_RESP_ORDER; @@ -463,19 +464,19 @@ typedef struct _RAIL_LANGUAGEIME_INFO_ORDER RAIL_LANGUAGEIME_INFO_ORDER; struct _RAIL_SNAP_ARRANGE { UINT32 windowId; - UINT16 left; - UINT16 top; - UINT16 right; - UINT16 bottom; + INT16 left; + INT16 top; + INT16 right; + INT16 bottom; }; typedef struct _RAIL_SNAP_ARRANGE RAIL_SNAP_ARRANGE; struct _RAIL_GET_APPID_RESP_EX { UINT32 windowID; - WCHAR applicationID[512 / sizeof(WCHAR)]; + WCHAR applicationID[520 / sizeof(WCHAR)]; UINT32 processId; - WCHAR processImageName[512 / sizeof(WCHAR)]; + WCHAR processImageName[520 / sizeof(WCHAR)]; }; typedef struct _RAIL_GET_APPID_RESP_EX RAIL_GET_APPID_RESP_EX; diff --git a/winpr/include/winpr/stream.h b/winpr/include/winpr/stream.h index f88d39f..0f81532 100644 --- a/winpr/include/winpr/stream.h +++ b/winpr/include/winpr/stream.h @@ -180,6 +180,12 @@ static INLINE void Stream_Write_UINT8(wStream* _s, UINT8 _v) *_s->pointer++ = (UINT8)(_v); } +static INLINE void Stream_Write_INT16(wStream* _s, INT16 _v) +{ + *_s->pointer++ = (_v) & 0xFF; + *_s->pointer++ = ((_v) >> 8) & 0xFF; +} + static INLINE void Stream_Write_UINT16(wStream* _s, UINT16 _v) { *_s->pointer++ = (_v) & 0xFF; -- 2.7.4