From: Armin Novak Date: Thu, 11 Feb 2021 11:43:05 +0000 (+0100) Subject: Compatibility commit for RDPEI API X-Git-Tag: 2.3.0~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e3dce02641ce66974c3a5470bca1e053e4abcaa;p=platform%2Fupstream%2Ffreerdp.git Compatibility commit for RDPEI API --- diff --git a/channels/rdpei/server/rdpei_main.c b/channels/rdpei/server/rdpei_main.c index c046d1f..80ab4b6 100644 --- a/channels/rdpei/server/rdpei_main.c +++ b/channels/rdpei/server/rdpei_main.c @@ -207,6 +207,7 @@ static UINT read_cs_ready_message(RdpeiServerContext* context, wStream* s) static UINT read_touch_contact_data(RdpeiServerContext* context, wStream* s, RDPINPUT_CONTACT_DATA* contactData) { + UINT16 tmp; WINPR_UNUSED(context); if (Stream_GetRemainingLength(s) < 1) { @@ -215,25 +216,28 @@ static UINT read_touch_contact_data(RdpeiServerContext* context, wStream* s, } Stream_Read_UINT8(s, contactData->contactId); - if (!rdpei_read_2byte_unsigned(s, &contactData->fieldsPresent) || - !rdpei_read_4byte_signed(s, &contactData->x) || + if (!rdpei_read_2byte_unsigned(s, &tmp) || !rdpei_read_4byte_signed(s, &contactData->x) || !rdpei_read_4byte_signed(s, &contactData->y) || !rdpei_read_4byte_unsigned(s, &contactData->contactFlags)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; } + contactData->fieldsPresent = tmp; if (contactData->fieldsPresent & CONTACT_DATA_CONTACTRECT_PRESENT) { - if (!rdpei_read_2byte_signed(s, &contactData->contactRectLeft) || - !rdpei_read_2byte_signed(s, &contactData->contactRectTop) || - !rdpei_read_2byte_signed(s, &contactData->contactRectRight) || - !rdpei_read_2byte_signed(s, &contactData->contactRectBottom)) + INT16 tmp[4] = { 0 }; + if (!rdpei_read_2byte_signed(s, &tmp[0]) || !rdpei_read_2byte_signed(s, &tmp[1]) || + !rdpei_read_2byte_signed(s, &tmp[2]) || !rdpei_read_2byte_signed(s, &tmp[3])) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; } + contactData->contactRectLeft = tmp[0]; + contactData->contactRectTop = tmp[1]; + contactData->contactRectRight = tmp[2]; + contactData->contactRectBottom = tmp[3]; } if ((contactData->fieldsPresent & CONTACT_DATA_ORIENTATION_PRESENT) && @@ -310,15 +314,16 @@ static UINT read_pen_contact(RdpeiServerContext* context, wStream* s, static UINT read_touch_frame(RdpeiServerContext* context, wStream* s, RDPINPUT_TOUCH_FRAME* frame) { UINT32 i; + UINT16 tmp; RDPINPUT_CONTACT_DATA* contact; UINT error; - if (!rdpei_read_2byte_unsigned(s, &frame->contactCount) || - !rdpei_read_8byte_unsigned(s, &frame->frameOffset)) + if (!rdpei_read_2byte_unsigned(s, &tmp) || !rdpei_read_8byte_unsigned(s, &frame->frameOffset)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; } + frame->contactCount = tmp; frame->contacts = contact = calloc(frame->contactCount, sizeof(RDPINPUT_CONTACT_DATA)); if (!frame->contacts) diff --git a/include/freerdp/channels/rdpei.h b/include/freerdp/channels/rdpei.h index edb6d6b..03bb3e8 100644 --- a/include/freerdp/channels/rdpei.h +++ b/include/freerdp/channels/rdpei.h @@ -38,6 +38,9 @@ enum }; /* Client Ready Flags */ +#define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 /* Deprecated */ +#define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 /* Deprecated */ + #define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 #define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 #define CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTION 0x00000004 @@ -76,14 +79,14 @@ typedef enum struct _RDPINPUT_CONTACT_DATA { UINT32 contactId; - UINT16 fieldsPresent; + UINT32 fieldsPresent; INT32 x; INT32 y; UINT32 contactFlags; - INT16 contactRectLeft; - INT16 contactRectTop; - INT16 contactRectRight; - INT16 contactRectBottom; + INT32 contactRectLeft; + INT32 contactRectTop; + INT32 contactRectRight; + INT32 contactRectBottom; UINT32 orientation; UINT32 pressure; }; @@ -92,7 +95,7 @@ typedef struct _RDPINPUT_CONTACT_DATA RDPINPUT_CONTACT_DATA; /** @brief a frame containing contact points */ struct _RDPINPUT_TOUCH_FRAME { - UINT16 contactCount; + UINT32 contactCount; UINT64 frameOffset; RDPINPUT_CONTACT_DATA* contacts; }; diff --git a/include/freerdp/client/rdpei.h b/include/freerdp/client/rdpei.h index 7c350cf..e635ffd 100644 --- a/include/freerdp/client/rdpei.h +++ b/include/freerdp/client/rdpei.h @@ -57,7 +57,6 @@ struct _rdpei_client_context void* custom; pcRdpeiGetVersion GetVersion; - pcRdpeiGetFeatures GetFeatures; pcRdpeiAddContact AddContact; @@ -65,14 +64,15 @@ struct _rdpei_client_context pcRdpeiTouchUpdate TouchUpdate; pcRdpeiTouchEnd TouchEnd; + pcRdpeiSuspendTouch SuspendTouch; + pcRdpeiResumeTouch ResumeTouch; + + pcRdpeiGetFeatures GetFeatures; pcRdpeiAddPen AddPen; pcRdpeiPen PenBegin; pcRdpeiPen PenUpdate; pcRdpeiPen PenEnd; - - pcRdpeiSuspendTouch SuspendTouch; - pcRdpeiResumeTouch ResumeTouch; }; #endif /* FREERDP_CHANNEL_RDPEI_CLIENT_RDPEI_H */