Debian Codegraph @

channels/rdpei/client/rdpei_main.c

raw symbols SCIP
1 /**
2 * FreeRDP: A Remote Desktop Protocol Implementation
3 * Input Virtual Channel Extension
4 *
5 * Copyright 2013 Marc-Andre Moreau <[email protected]>
6 * Copyright 2015 Thincast Technologies GmbH
7 * Copyright 2015 DI (FH) Martin Haimberger <[email protected]>
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 #include <freerdp/config.h>cxx . . $ `<file>/build/include/freerdp/config.h`/
23
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <stdint.h>
28
29 #include <winpr/crt.h>cxx . . $ `<file>/winpr/include/winpr/crt.h`/
30 #include <winpr/cast.h>cxx . . $ `<file>/winpr/include/winpr/cast.h`/
31 #include <winpr/synch.h>cxx . . $ `<file>/winpr/include/winpr/synch.h`/
32 #include <winpr/thread.h>cxx . . $ `<file>/winpr/include/winpr/thread.h`/
33 #include <winpr/stream.h>cxx . . $ `<file>/winpr/include/winpr/stream.h`/
34 #include <winpr/sysinfo.h>cxx . . $ `<file>/winpr/include/winpr/sysinfo.h`/
35 #include <winpr/cmdline.h>cxx . . $ `<file>/winpr/include/winpr/cmdline.h`/
36 #include <winpr/collections.h>cxx . . $ `<file>/winpr/include/winpr/collections.h`/
37
38 #include <freerdp/addin.h>cxx . . $ `<file>/include/freerdp/addin.h`/
39 #include <freerdp/freerdp.h>cxx . . $ `<file>/include/freerdp/freerdp.h`/
40 #include <freerdp/client/channels.h>cxx . . $ `<file>/include/freerdp/client/channels.h`/
41
42 #include "rdpei_common.h"cxx . . $ `<file>/channels/rdpei/rdpei_common.h`/
43
44 #include "rdpei_main.h"cxx . . $ `<file>/channels/rdpei/client/rdpei_main.h`/
45
46 #define RDPEI_TAGcxx . . $ `channels/rdpei/client/rdpei_main.c:46:9`! CHANNELS_TAGcxx . . $ `include/freerdp/channels/log.h:26:9`!("rdpei.client")
47
48 /**
49 * Touch Input
50 * http://msdn.microsoft.com/en-us/library/windows/desktop/dd562197/
51 *
52 * Windows Touch Input
53 * http://msdn.microsoft.com/en-us/library/windows/desktop/dd317321/
54 *
55 * Input: Touch injection sample
56 * http://code.msdn.microsoft.com/windowsdesktop/Touch-Injection-Sample-444d9bf7
57 *
58 * Pointer Input Message Reference
59 * http://msdn.microsoft.com/en-us/library/hh454916/
60 *
61 * POINTER_INFO Structure
62 * http://msdn.microsoft.com/en-us/library/hh454907/
63 *
64 * POINTER_TOUCH_INFO Structure
65 * http://msdn.microsoft.com/en-us/library/hh454910/
66 */
67
68 #define MAX_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:68:9`! 64
69 #define MAX_PEN_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:69:9`! 4
70
71 typedef structcxx . . $ $anonymous_type_ea19c5b41633425d_0#
72 {
73 GENERIC_DYNVC_PLUGINcxx . . $ GENERIC_DYNVC_PLUGIN# basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base.;
74
75 RdpeiClientContextcxx . . $ RdpeiClientContext#* contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.;
76
77 UINT32cxx . . $ UINT32# versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version.;
78 UINT32cxx . . $ UINT32# featurescxx . . $ $anonymous_type_ea19c5b41633425d_0#features.; /* SC_READY_MULTIPEN_INJECTION_SUPPORTED */
79 UINT16cxx . . $ UINT16# maxTouchContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxTouchContacts.;
80 UINT64cxx . . $ UINT64# currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime.;
81 UINT64cxx . . $ UINT64# previousFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousFrameTime.;
82 RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT# contactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#contactPoints.[MAX_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:68:9`!];
83
84 UINT64cxx . . $ UINT64# currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime.;
85 UINT64cxx . . $ UINT64# previousPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousPenFrameTime.;
86 UINT16cxx . . $ UINT16# maxPenContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxPenContacts.;
87 RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT# penContactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#penContactPoints.[MAX_PEN_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:69:9`!];
88
89 CRITICAL_SECTIONcxx . . $ CRITICAL_SECTION# lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.;
90 rdpContextcxx . . $ rdpContext#* rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.;
91
92 HANDLEcxx . . $ HANDLE# threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread.;
93
94 HANDLEcxx . . $ HANDLE# eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.;
95 UINT64cxx . . $ UINT64# lastPollEventTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#lastPollEventTime.;
96 BOOLcxx . . $ BOOL# runningcxx . . $ $anonymous_type_ea19c5b41633425d_0#running.;
97 BOOLcxx . . $ BOOL# asynccxx . . $ $anonymous_type_ea19c5b41633425d_0#async.;
98 } RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#;
99
100 /**
101 * Function description
102 *
103 * @return 0 on success, otherwise a Win32 error code
104 */
105 static UINTcxx . . $ UINT# rdpei_send_framecxx . . $ rdpei_send_frame(8fd0fc4ee0a5cd6b).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, RDPINPUT_TOUCH_FRAMEcxx . . $ RDPINPUT_TOUCH_FRAME#* frame);
106
107 #ifdef WITH_DEBUG_RDPEI
108 static const char* rdpei_eventid_string(UINT16 event)
109 {
110 switch (event)
111 {
112 case EVENTID_SC_READY:
113 return "EVENTID_SC_READY";
114 case EVENTID_CS_READY:
115 return "EVENTID_CS_READY";
116 case EVENTID_TOUCH:
117 return "EVENTID_TOUCH";
118 case EVENTID_SUSPEND_TOUCH:
119 return "EVENTID_SUSPEND_TOUCH";
120 case EVENTID_RESUME_TOUCH:
121 return "EVENTID_RESUME_TOUCH";
122 case EVENTID_DISMISS_HOVERING_CONTACT:
123 return "EVENTID_DISMISS_HOVERING_CONTACT";
124 case EVENTID_PEN:
125 return "EVENTID_PEN";
126 default:
127 return "EVENTID_UNKNOWN";
128 }
129 }
130 #endif
131
132 static RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT#* rdpei_contactcxx . . $ rdpei_contact(718d6ad0a67c0ba7).(RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei, INT32cxx . . $ INT32# externalId, BOOLcxx . . $ BOOL# active)
133 {
134 for (UINT16cxx . . $ UINT16# i = 0; i < rdpei->maxTouchContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxTouchContacts.; i++)
135 {
136 RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT#* contactPoint = &rdpei->contactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#contactPoints.[i];
137
138 if (!contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active. && active)
139 continue;
140 else if (!contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active. && !active)
141 {
142 contactPoint->contactIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#contactId. = i;
143 contactPoint->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#externalId. = externalId;
144 contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
145 return contactPoint;
146 }
147 else if (contactPoint->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#externalId. == externalId)
148 {
149 return contactPoint;
150 }
151 }
152 return nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!;
153 }
154
155 /**
156 * Function description
157 *
158 * @return 0 on success, otherwise a Win32 error code
159 */
160 static UINTcxx . . $ UINT# rdpei_add_framecxx . . $ rdpei_add_frame(1aa15a32261634f0).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context)
161 {
162 RDPINPUT_TOUCH_FRAMEcxx . . $ RDPINPUT_TOUCH_FRAME# frame = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
163 RDPINPUT_CONTACT_DATAcxx . . $ RDPINPUT_CONTACT_DATA# contacts[MAX_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:68:9`!] = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
164
165 if (!context || !context->handlecxx . . $ s_rdpei_client_context#handle.)
166 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
167
168 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
169 frame.contactscxx . . $ $anonymous_type_4af69d5da9134dfb_5#contacts. = contacts;
170
171 for (UINT16cxx . . $ UINT16# i = 0; i < rdpei->maxTouchContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxTouchContacts.; i++)
172 {
173 RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT#* contactPoint = &rdpei->contactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#contactPoints.[i];
174 RDPINPUT_CONTACT_DATAcxx . . $ RDPINPUT_CONTACT_DATA#* contact = &contactPoint->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#data.;
175
176 if (contactPoint->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#dirty.)
177 {
178 contacts[frame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.] = *contact;
179 rdpei->contactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#contactPoints.[i].dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#dirty. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
180 frame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.++;
181 }
182 else if (contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active.)
183 {
184 if (contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. & RDPINPUT_CONTACT_FLAG_DOWNcxx . . $ RDPINPUT_CONTACT_FLAG_DOWN.)
185 {
186 contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. = RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE.;
187 contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. |= RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE.;
188 contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. |= RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.;
189 }
190
191 contacts[frame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.] = *contact;
192 frame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.++;
193 }
194 if (contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. & RDPINPUT_CONTACT_FLAG_UPcxx . . $ RDPINPUT_CONTACT_FLAG_UP.)
195 {
196 contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
197 contactPoint->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#externalId. = 0;
198 contactPoint->contactIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#contactId. = 0;
199 }
200 }
201
202 if (frame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount. > 0)
203 {
204 UINTcxx . . $ UINT# error = rdpei_send_framecxx . . $ rdpei_send_frame(8fd0fc4ee0a5cd6b).(context, &frame);
205 if (error != CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!)
206 {
207 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
208 "rdpei_send_frame failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
209 return error;
210 }
211 }
212 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
213 }
214
215 /**
216 * Function description
217 *
218 * @return 0 on success, otherwise a Win32 error code
219 */
220 static UINTcxx . . $ UINT# rdpei_send_pducxx . . $ rdpei_send_pdu(c52496e40d89f963).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, wStreamcxx . . $ wStream#* s, UINT16cxx . . $ UINT16# eventId,
221 size_t pduLength)
222 {
223 if (!callback || !s || !callback->channelcxx . . $ $anonymous_type_b3a06c54c4b60133_0#channel. || !callback->channelcxx . . $ $anonymous_type_b3a06c54c4b60133_0#channel.->Writecxx . . $ s_IWTSVirtualChannel#Write.)
224 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
225
226 if (pduLength > UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:124:10`!)
227 return ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
228
229 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
230 if (!rdpei)
231 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
232
233 Stream_ResetPositioncxx . . $ Stream_ResetPosition(141d0e356bb21ff3).(s);
234 Stream_Write_UINT16cxx . . $ `winpr/include/winpr/stream.h:908:9`!(s, eventId); /* eventId (2 bytes) */
235 Stream_Write_UINT32cxx . . $ `winpr/include/winpr/stream.h:1070:9`!(s, (UINT32)pduLength); /* pduLength (4 bytes) */
236 if (!Stream_SetPositioncxx . . $ Stream_SetPosition(db6c6e3e90d014c4).(s, Stream_Lengthcxx . . $ Stream_Length(ebc7f695a8644dc0).(s)))
237 return ERROR_INVALID_DATAcxx . . $ `winpr/include/winpr/error.h:198:9`!;
238 const UINTcxx . . $ UINT# status = callback->channelcxx . . $ $anonymous_type_b3a06c54c4b60133_0#channel.->Writecxx . . $ s_IWTSVirtualChannel#Write.(callback->channelcxx . . $ $anonymous_type_b3a06c54c4b60133_0#channel., (UINT32cxx . . $ UINT32#)Stream_Lengthcxx . . $ Stream_Length(ebc7f695a8644dc0).(s),
239 Stream_Buffercxx . . $ Stream_Buffer(38abee8bfc36c01e).(s), nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!);
240 #ifdef WITH_DEBUG_RDPEI
241 WLog_Print(rdpei->base.log, WLOG_DEBUG,
242 "rdpei_send_pdu: eventId: %" PRIu16 " (%s) length: %" PRIuz " status: %" PRIu32 "",
243 eventId, rdpei_eventid_string(eventId), pduLength, status);
244 #endif
245 return status;
246 }
247
248 static UINTcxx . . $ UINT# rdpei_write_pen_framecxx . . $ rdpei_write_pen_frame(38620d7bbcde2998).(wStreamcxx . . $ wStream#* s, const RDPINPUT_PEN_FRAMEcxx . . $ RDPINPUT_PEN_FRAME#* frame)
249 {
250 if (!s || !frame)
251 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
252
253 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_8#contactCount.))
254 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
255 if (!rdpei_write_8byte_unsignedcxx . . $ rdpei_write_8byte_unsigned(db6c6e3e90d014c4).(s, frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_8#frameOffset.))
256 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
257 for (UINT16cxx . . $ UINT16# x = 0; x < frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_8#contactCount.; x++)
258 {
259 const RDPINPUT_PEN_CONTACTcxx . . $ RDPINPUT_PEN_CONTACT#* contact = &frame->contactscxx . . $ $anonymous_type_4af69d5da9134dfb_8#contacts.[x];
260
261 if (!Stream_EnsureRemainingCapacitycxx . . $ Stream_EnsureRemainingCapacity(db6c6e3e90d014c4).(s, 1))
262 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
263 Stream_Write_UINT8cxx . . $ `winpr/include/winpr/stream.h:857:9`!(s, contact->deviceId);
264 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent.))
265 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
266 if (!rdpei_write_4byte_signedcxx . . $ rdpei_write_4byte_signed(cfe567810f8b9088).(s, contact->xcxx . . $ $anonymous_type_4af69d5da9134dfb_7#x.))
267 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
268 if (!rdpei_write_4byte_signedcxx . . $ rdpei_write_4byte_signed(cfe567810f8b9088).(s, contact->ycxx . . $ $anonymous_type_4af69d5da9134dfb_7#y.))
269 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
270 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags.))
271 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
272 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. & RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT.)
273 {
274 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->penFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#penFlags.))
275 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
276 }
277 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. & RDPINPUT_PEN_CONTACT_PRESSURE_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT.)
278 {
279 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->pressurecxx . . $ $anonymous_type_4af69d5da9134dfb_7#pressure.))
280 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
281 }
282 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. & RDPINPUT_PEN_CONTACT_ROTATION_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_ROTATION_PRESENT.)
283 {
284 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, contact->rotationcxx . . $ $anonymous_type_4af69d5da9134dfb_7#rotation.))
285 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
286 }
287 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. & RDPINPUT_PEN_CONTACT_TILTX_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_TILTX_PRESENT.)
288 {
289 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->tiltXcxx . . $ $anonymous_type_4af69d5da9134dfb_7#tiltX.))
290 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
291 }
292 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. & RDPINPUT_PEN_CONTACT_TILTY_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_TILTY_PRESENT.)
293 {
294 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->tiltYcxx . . $ $anonymous_type_4af69d5da9134dfb_7#tiltY.))
295 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
296 }
297 }
298 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
299 }
300
301 static UINTcxx . . $ UINT# rdpei_send_pen_event_pducxx . . $ rdpei_send_pen_event_pdu(1780285195701d0).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, size_t frameOffset,
302 const RDPINPUT_PEN_FRAMEcxx . . $ RDPINPUT_PEN_FRAME#* frames, size_t count)
303 {
304 UINTcxx . . $ UINT# status = ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
305 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(callback);
306
307 if (frameOffset > UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:124:10`!)
308 return ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
309 if (count > UINT16_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:123:10`!)
310 return ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
311
312 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
313 if (!rdpei)
314 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
315
316 if (!frames || (count == 0))
317 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
318
319 wStreamcxx . . $ wStream#* s = Stream_Newcxx . . $ Stream_New(af7e1125a927123a).(nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, 64);
320
321 if (!s)
322 {
323 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "Stream_New failed!");
324 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
325 }
326
327 Stream_Seekcxx . . $ Stream_Seek(e1fedc387646b1c9).(s, RDPINPUT_HEADER_LENGTHcxx . . $ `include/freerdp/channels/rdpei.h:32:9`!);
328 /**
329 * the time that has elapsed (in milliseconds) from when the oldest touch frame
330 * was generated to when it was encoded for transmission by the client.
331 */
332 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(
333 s, (UINT32cxx . . $ UINT32#)frameOffset)) /* encodeTime (FOUR_BYTE_UNSIGNED_INTEGER) */
334 goto fail;
335 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, (UINT16cxx . . $ UINT16#)count)) /* (frameCount) TWO_BYTE_UNSIGNED_INTEGER */
336 goto fail;
337
338 for (size_t x = 0; x < count; x++)
339 {
340 status = rdpei_write_pen_framecxx . . $ rdpei_write_pen_frame(38620d7bbcde2998).(s, &frames[x]);
341 if (status)
342 {
343 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
344 "rdpei_write_pen_frame failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", status);
345 goto fail;
346 }
347 }
348 Stream_SealLengthcxx . . $ Stream_SealLength(141d0e356bb21ff3).(s);
349
350 status = rdpei_send_pducxx . . $ rdpei_send_pdu(c52496e40d89f963).(callback, s, EVENTID_PENcxx . . $ EVENTID_PEN., Stream_Lengthcxx . . $ Stream_Length(ebc7f695a8644dc0).(s));
351 fail:
352 Stream_Freecxx . . $ Stream_Free(31813de2214206e2).(s, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!);
353 return status;
354 }
355
356 static UINTcxx . . $ UINT# rdpei_send_pen_framecxx . . $ rdpei_send_pen_frame(e84f528e6e6f90f5).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, RDPINPUT_PEN_FRAMEcxx . . $ RDPINPUT_PEN_FRAME#* frame)
357 {
358 const UINT64cxx . . $ UINT64# currentTime = GetTickCount64cxx . . $ `winpr/include/winpr/sysinfo.h:353:9`!();
359
360 if (!context)
361 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
362
363 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
364 if (!rdpei || !rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.)
365 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
366 if (!rdpei || !rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.)
367 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
368 if (freerdp_settings_get_boolcxx . . $ freerdp_settings_get_bool(c2a3b7001458211).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.->settingscxx . . $ rdp_context#settings., FreeRDP_SuspendInputcxx . . $ FreeRDP_SuspendInput.))
369 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
370
371 GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback = rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.->channel_callbackcxx . . $ $anonymous_type_b3a06c54c4b60133_1#channel_callback.;
372 /* Just ignore the event if the channel is not connected */
373 if (!callback)
374 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
375
376 if (!rdpei->previousPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousPenFrameTime. && !rdpei->currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime.)
377 {
378 rdpei->currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime. = currentTime;
379 frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_8#frameOffset. = 0;
380 }
381 else
382 {
383 rdpei->currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime. = currentTime;
384 frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_8#frameOffset. = rdpei->currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime. - rdpei->previousPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousPenFrameTime.;
385 }
386
387 const size_t off = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(size_t, frame->frameOffset);
388 const UINTcxx . . $ UINT# error = rdpei_send_pen_event_pducxx . . $ rdpei_send_pen_event_pdu(1780285195701d0).(callback, off, frame, 1);
389 if (error)
390 return error;
391
392 rdpei->previousPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousPenFrameTime. = rdpei->currentPenFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentPenFrameTime.;
393 return error;
394 }
395
396 static UINTcxx . . $ UINT# rdpei_add_pen_framecxx . . $ rdpei_add_pen_frame(1aa15a32261634f0).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context)
397 {
398 RDPINPUT_PEN_FRAMEcxx . . $ RDPINPUT_PEN_FRAME# penFrame = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
399 RDPINPUT_PEN_CONTACTcxx . . $ RDPINPUT_PEN_CONTACT# penContacts[MAX_PEN_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:69:9`!] = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
400
401 if (!context || !context->handlecxx . . $ s_rdpei_client_context#handle.)
402 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
403
404 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
405
406 penFrame.contactscxx . . $ $anonymous_type_4af69d5da9134dfb_8#contacts. = penContacts;
407
408 for (UINT16cxx . . $ UINT16# i = 0; i < rdpei->maxPenContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxPenContacts.; i++)
409 {
410 RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT#* contact = &(rdpei->penContactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#penContactPoints.[i]);
411
412 if (contact->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#dirty.)
413 {
414 penContacts[penFrame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_8#contactCount.++] = contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data.;
415 contact->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#dirty. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
416 }
417 else if (contact->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#active.)
418 {
419 if (contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. & RDPINPUT_CONTACT_FLAG_DOWNcxx . . $ RDPINPUT_CONTACT_FLAG_DOWN.)
420 {
421 contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. = RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE.;
422 contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. |= RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE.;
423 contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. |= RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.;
424 }
425
426 penContacts[penFrame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_8#contactCount.++] = contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data.;
427 }
428 if (contact->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. & RDPINPUT_CONTACT_FLAG_CANCELEDcxx . . $ RDPINPUT_CONTACT_FLAG_CANCELED.)
429 {
430 contact->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#externalId. = 0;
431 contact->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#active. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
432 }
433 }
434
435 if (penFrame.contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_8#contactCount. > 0)
436 return rdpei_send_pen_framecxx . . $ rdpei_send_pen_frame(e84f528e6e6f90f5).(context, &penFrame);
437 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
438 }
439
440 static UINTcxx . . $ UINT# rdpei_updatecxx . . $ rdpei_update(93112509ac02cfba).(wLogcxx . . $ wLog#* log, RdpeiClientContextcxx . . $ RdpeiClientContext#* context)
441 {
442 UINTcxx . . $ UINT# error = rdpei_add_framecxx . . $ rdpei_add_frame(1aa15a32261634f0).(context);
443 if (error != CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!)
444 {
445 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(log, WLOG_ERROR, "rdpei_add_frame failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
446 return error;
447 }
448
449 return rdpei_add_pen_framecxx . . $ rdpei_add_pen_frame(1aa15a32261634f0).(context);
450 }
451
452 static BOOLcxx . . $ BOOL# rdpei_poll_run_unlockedcxx . . $ rdpei_poll_run_unlocked(b5c4d77fcfed236e).(rdpContextcxx . . $ rdpContext#* context, void* userdata)
453 {
454 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = userdata;
455 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(rdpei);
456 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(context);
457
458 const UINT64cxx . . $ UINT64# now = GetTickCount64cxx . . $ `winpr/include/winpr/sysinfo.h:353:9`!();
459
460 /* Send an event every ~20ms */
461 if ((now < rdpei->lastPollEventTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#lastPollEventTime.) || (now - rdpei->lastPollEventTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#lastPollEventTime. < 20ULL))
462 return TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
463
464 rdpei->lastPollEventTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#lastPollEventTime. = now;
465
466 const UINTcxx . . $ UINT# error = rdpei_updatecxx . . $ rdpei_update(93112509ac02cfba).(rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..logcxx . . $ GENERIC_DYNVC_PLUGIN#log., rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.);
467
468 (void)ResetEventcxx . . $ ResetEvent(dedf1e9b1c614a07).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
469
470 if (error != CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!)
471 {
472 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "rdpei_add_frame failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!",
473 error);
474 setChannelErrorcxx . . $ setChannelError(5de635fef11cc662).(context, error, "rdpei_add_frame reported an error");
475 return FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
476 }
477
478 return TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
479 }
480
481 static BOOLcxx . . $ BOOL# rdpei_poll_runcxx . . $ rdpei_poll_run(b5c4d77fcfed236e).(rdpContextcxx . . $ rdpContext#* context, void* userdata)
482 {
483 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = userdata;
484 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(rdpei);
485
486 EnterCriticalSectioncxx . . $ EnterCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
487 BOOLcxx . . $ BOOL# rc = rdpei_poll_run_unlockedcxx . . $ rdpei_poll_run_unlocked(b5c4d77fcfed236e).(context, userdata);
488 LeaveCriticalSectioncxx . . $ LeaveCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
489 return rc;
490 }
491
492 static DWORDcxx . . $ DWORD# WINAPIcxx . . $ `winpr/include/winpr/wtypes.h:84:9`! rdpei_periodic_updatecxx . . $ rdpei_periodic_update(6769d0e399bf81e3).(LPVOIDcxx . . $ LPVOID# arg)
493 {
494 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)arg;
495 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
496
497 if (!rdpei)
498 {
499 error = ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
500 goto out;
501 }
502
503 if (!rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.)
504 {
505 error = ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
506 goto out;
507 }
508
509 while (rdpei->runningcxx . . $ $anonymous_type_ea19c5b41633425d_0#running.)
510 {
511 const DWORDcxx . . $ DWORD# status = WaitForSingleObjectcxx . . $ WaitForSingleObject(35feec062aeef876).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event., 20);
512
513 if (status == WAIT_FAILEDcxx . . $ `winpr/include/winpr/synch.h:222:9`!)
514 {
515 error = GetLastErrorcxx . . $ GetLastError(db52760e79bf9054).();
516 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
517 "WaitForMultipleObjects failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
518 break;
519 }
520
521 if (!rdpei_poll_runcxx . . $ rdpei_poll_run(b5c4d77fcfed236e).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext., rdpei))
522 error = ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
523 }
524
525 out:
526
527 if (error && rdpei && rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.)
528 setChannelErrorcxx . . $ setChannelError(5de635fef11cc662).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext., error, "rdpei_schedule_thread reported an error");
529
530 if (rdpei)
531 rdpei->runningcxx . . $ $anonymous_type_ea19c5b41633425d_0#running. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
532
533 ExitThreadcxx . . $ ExitThread(cb2f890c2fdad230).(error);
534 return error;
535 }
536
537 /**
538 * Function description
539 *
540 * @return 0 on success, otherwise a Win32 error code
541 */
542 static UINTcxx . . $ UINT# rdpei_send_cs_ready_pducxx . . $ rdpei_send_cs_ready_pdu(60d8812f7e930a9c).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback)
543 {
544 if (!callback || !callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.)
545 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
546
547 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
548
549 UINT32cxx . . $ UINT32# flags = CS_READY_FLAGS_SHOW_TOUCH_VISUALScxx . . $ `include/freerdp/channels/rdpei.h:58:9`! & rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.->clientFeaturesMaskcxx . . $ s_rdpei_client_context#clientFeaturesMask.;
550 if (rdpei->versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version. > RDPINPUT_PROTOCOL_V10cxx . . $ RDPINPUT_PROTOCOL_V10.)
551 flags |= CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTIONcxx . . $ `include/freerdp/channels/rdpei.h:59:9`! & rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.->clientFeaturesMaskcxx . . $ s_rdpei_client_context#clientFeaturesMask.;
552 if (rdpei->featurescxx . . $ $anonymous_type_ea19c5b41633425d_0#features. & SC_READY_MULTIPEN_INJECTION_SUPPORTEDcxx . . $ `include/freerdp/channels/rdpei.h:55:9`!)
553 flags |= CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTIONcxx . . $ `include/freerdp/channels/rdpei.h:60:9`! & rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.->clientFeaturesMaskcxx . . $ s_rdpei_client_context#clientFeaturesMask.;
554
555 UINT32cxx . . $ UINT32# pduLength = RDPINPUT_HEADER_LENGTHcxx . . $ `include/freerdp/channels/rdpei.h:32:9`! + 10;
556 wStreamcxx . . $ wStream#* s = Stream_Newcxx . . $ Stream_New(af7e1125a927123a).(nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, pduLength);
557
558 if (!s)
559 {
560 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "Stream_New failed!");
561 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
562 }
563
564 Stream_Seekcxx . . $ Stream_Seek(e1fedc387646b1c9).(s, RDPINPUT_HEADER_LENGTHcxx . . $ `include/freerdp/channels/rdpei.h:32:9`!);
565 Stream_Write_UINT32cxx . . $ `winpr/include/winpr/stream.h:1070:9`!(s, flags); /* flags (4 bytes) */
566 Stream_Write_UINT32cxx . . $ `winpr/include/winpr/stream.h:1070:9`!(s, rdpei->version); /* protocolVersion (4 bytes) */
567 Stream_Write_UINT16cxx . . $ `winpr/include/winpr/stream.h:908:9`!(s, rdpei->maxTouchContacts); /* maxTouchContacts (2 bytes) */
568 Stream_SealLengthcxx . . $ Stream_SealLength(141d0e356bb21ff3).(s);
569
570 const UINTcxx . . $ UINT# status = rdpei_send_pducxx . . $ rdpei_send_pdu(c52496e40d89f963).(callback, s, EVENTID_CS_READYcxx . . $ EVENTID_CS_READY., pduLength);
571 Stream_Freecxx . . $ Stream_Free(31813de2214206e2).(s, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!);
572 return status;
573 }
574
575 #if defined(WITH_DEBUG_RDPEI)
576 static void rdpei_print_contact_flags(wLog* log, UINT32 contactFlags)
577 {
578 if (contactFlags & RDPINPUT_CONTACT_FLAG_DOWN)
579 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_DOWN");
580
581 if (contactFlags & RDPINPUT_CONTACT_FLAG_UPDATE)
582 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_UPDATE");
583
584 if (contactFlags & RDPINPUT_CONTACT_FLAG_UP)
585 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_UP");
586
587 if (contactFlags & RDPINPUT_CONTACT_FLAG_INRANGE)
588 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_INRANGE");
589
590 if (contactFlags & RDPINPUT_CONTACT_FLAG_INCONTACT)
591 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_INCONTACT");
592
593 if (contactFlags & RDPINPUT_CONTACT_FLAG_CANCELED)
594 WLog_Print(log, WLOG_DEBUG, " RDPINPUT_CONTACT_FLAG_CANCELED");
595 }
596 #endif
597
598 static INT16cxx . . $ INT16# boundedcxx . . $ bounded(60050ad348e56ea6).(INT32cxx . . $ INT32# val)
599 {
600 if (val < INT16_MINcxx . . $ `<external>/3415975807581488833/stdint.h:112:10`!)
601 return INT16_MINcxx . . $ `<external>/3415975807581488833/stdint.h:112:10`!;
602 if (val > INT16_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:117:10`!)
603 return INT16_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:117:10`!;
604 return (INT16cxx . . $ INT16#)val;
605 }
606
607 /**
608 * Function description
609 *
610 * @return 0 on success, otherwise a Win32 error code
611 */
612 static UINTcxx . . $ UINT# rdpei_write_touch_framecxx . . $ rdpei_write_touch_frame(11c6ef91d4ee74ea).(wLogcxx . . $ wLog#* log, wStreamcxx . . $ wStream#* s, RDPINPUT_TOUCH_FRAMEcxx . . $ RDPINPUT_TOUCH_FRAME#* frame)
613 {
614 int rectSize = 2;
615 if (!s || !frame)
616 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
617 #ifdef WITH_DEBUG_RDPEI
618 WLog_Print(log, WLOG_DEBUG, "contactCount: %" PRIu32 "", frame->contactCount);
619 WLog_Print(log, WLOG_DEBUG, "frameOffset: 0x%016" PRIX64 "", frame->frameOffset);
620 #endif
621 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(
622 s, frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.)) /* contactCount (TWO_BYTE_UNSIGNED_INTEGER) */
623 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
624 /**
625 * the time offset from the previous frame (in microseconds).
626 * If this is the first frame being transmitted then this field MUST be set to zero.
627 */
628 if (!rdpei_write_8byte_unsignedcxx . . $ rdpei_write_8byte_unsigned(db6c6e3e90d014c4).(s, frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_5#frameOffset. *
629 1000)) /* frameOffset (EIGHT_BYTE_UNSIGNED_INTEGER) */
630 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
631
632 if (!Stream_EnsureRemainingCapacitycxx . . $ Stream_EnsureRemainingCapacity(db6c6e3e90d014c4).(s, (size_t)frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount. * 64))
633 {
634 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(log, WLOG_ERROR, "Stream_EnsureRemainingCapacity failed!");
635 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
636 }
637
638 for (UINT32cxx . . $ UINT32# index = 0; index < frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.; index++)
639 {
640 RDPINPUT_CONTACT_DATAcxx . . $ RDPINPUT_CONTACT_DATA#* contact = &frame->contactscxx . . $ $anonymous_type_4af69d5da9134dfb_5#contacts.[index];
641
642 contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent. |= CONTACT_DATA_CONTACTRECT_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:63:9`!;
643 contact->contactRectLeftcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectLeft. = boundedcxx . . $ bounded(60050ad348e56ea6).(contact->xcxx . . $ $anonymous_type_4af69d5da9134dfb_4#x. - rectSize);
644 contact->contactRectTopcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectTop. = boundedcxx . . $ bounded(60050ad348e56ea6).(contact->ycxx . . $ $anonymous_type_4af69d5da9134dfb_4#y. - rectSize);
645 contact->contactRectRightcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectRight. = boundedcxx . . $ bounded(60050ad348e56ea6).(contact->xcxx . . $ $anonymous_type_4af69d5da9134dfb_4#x. + rectSize);
646 contact->contactRectBottomcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectBottom. = boundedcxx . . $ bounded(60050ad348e56ea6).(contact->ycxx . . $ $anonymous_type_4af69d5da9134dfb_4#y. + rectSize);
647 #ifdef WITH_DEBUG_RDPEI
648 WLog_Print(log, WLOG_DEBUG, "contact[%" PRIu32 "].contactId: %" PRIu32 "", index,
649 contact->contactId);
650 WLog_Print(log, WLOG_DEBUG, "contact[%" PRIu32 "].fieldsPresent: %" PRIu32 "", index,
651 contact->fieldsPresent);
652 WLog_Print(log, WLOG_DEBUG, "contact[%" PRIu32 "].x: %" PRId32 "", index, contact->x);
653 WLog_Print(log, WLOG_DEBUG, "contact[%" PRIu32 "].y: %" PRId32 "", index, contact->y);
654 WLog_Print(log, WLOG_DEBUG, "contact[%" PRIu32 "].contactFlags: 0x%08" PRIX32 "", index,
655 contact->contactFlags);
656 rdpei_print_contact_flags(log, contact->contactFlags);
657 #endif
658 Stream_Write_UINT8cxx . . $ `winpr/include/winpr/stream.h:857:9`!(
659 s, WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(uint8_t, contact->contactId)); /* contactId (1 byte) */
660 /* fieldsPresent (TWO_BYTE_UNSIGNED_INTEGER) */
661 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent.))
662 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
663 if (!rdpei_write_4byte_signedcxx . . $ rdpei_write_4byte_signed(cfe567810f8b9088).(s, contact->xcxx . . $ $anonymous_type_4af69d5da9134dfb_4#x.)) /* x (FOUR_BYTE_SIGNED_INTEGER) */
664 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
665 if (!rdpei_write_4byte_signedcxx . . $ rdpei_write_4byte_signed(cfe567810f8b9088).(s, contact->ycxx . . $ $anonymous_type_4af69d5da9134dfb_4#y.)) /* y (FOUR_BYTE_SIGNED_INTEGER) */
666 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
667 /* contactFlags (FOUR_BYTE_UNSIGNED_INTEGER) */
668 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags.))
669 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
670
671 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent. & CONTACT_DATA_CONTACTRECT_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:63:9`!)
672 {
673 /* contactRectLeft (TWO_BYTE_SIGNED_INTEGER) */
674 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->contactRectLeftcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectLeft.))
675 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
676 /* contactRectTop (TWO_BYTE_SIGNED_INTEGER) */
677 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->contactRectTopcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectTop.))
678 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
679 /* contactRectRight (TWO_BYTE_SIGNED_INTEGER) */
680 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->contactRectRightcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectRight.))
681 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
682 /* contactRectBottom (TWO_BYTE_SIGNED_INTEGER) */
683 if (!rdpei_write_2byte_signedcxx . . $ rdpei_write_2byte_signed(5a3c45341061e8f9).(s, contact->contactRectBottomcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectBottom.))
684 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
685 }
686
687 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent. & CONTACT_DATA_ORIENTATION_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:64:9`!)
688 {
689 /* orientation (FOUR_BYTE_UNSIGNED_INTEGER) */
690 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->orientationcxx . . $ $anonymous_type_4af69d5da9134dfb_4#orientation.))
691 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
692 }
693
694 if (contact->fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent. & CONTACT_DATA_PRESSURE_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:65:9`!)
695 {
696 /* pressure (FOUR_BYTE_UNSIGNED_INTEGER) */
697 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(s, contact->pressurecxx . . $ $anonymous_type_4af69d5da9134dfb_4#pressure.))
698 return ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
699 }
700 }
701
702 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
703 }
704
705 /**
706 * Function description
707 *
708 * @return 0 on success, otherwise a Win32 error code
709 */
710 static UINTcxx . . $ UINT# rdpei_send_touch_event_pducxx . . $ rdpei_send_touch_event_pdu(9cddf9d1dcc1e273).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback,
711 RDPINPUT_TOUCH_FRAMEcxx . . $ RDPINPUT_TOUCH_FRAME#* frame)
712 {
713 UINTcxx . . $ UINT# status = ERROR_OUTOFMEMORYcxx . . $ `winpr/include/winpr/error.h:199:9`!;
714 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(callback);
715
716 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
717 if (!rdpei || !rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.)
718 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
719 if (freerdp_settings_get_boolcxx . . $ freerdp_settings_get_bool(c2a3b7001458211).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.->settingscxx . . $ rdp_context#settings., FreeRDP_SuspendInputcxx . . $ FreeRDP_SuspendInput.))
720 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
721
722 if (!frame)
723 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
724
725 size_t pduLength = 64ULL + (64ULL * frame->contactCountcxx . . $ $anonymous_type_4af69d5da9134dfb_5#contactCount.);
726 wStreamcxx . . $ wStream#* s = Stream_Newcxx . . $ Stream_New(af7e1125a927123a).(nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, pduLength);
727
728 if (!s)
729 {
730 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "Stream_New failed!");
731 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
732 }
733
734 if (!Stream_SafeZerocxx . . $ `winpr/include/winpr/stream.h:1245:9`!(s, RDPINPUT_HEADER_LENGTHcxx . . $ `include/freerdp/channels/rdpei.h:32:9`!))
735 goto fail;
736 /**
737 * the time that has elapsed (in milliseconds) from when the oldest touch frame
738 * was generated to when it was encoded for transmission by the client.
739 */
740 if (!rdpei_write_4byte_unsignedcxx . . $ rdpei_write_4byte_unsigned(7693a608c0278b17).(
741 s, (UINT32cxx . . $ UINT32#)frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_5#frameOffset.)) /* encodeTime (FOUR_BYTE_UNSIGNED_INTEGER) */
742 goto fail;
743 if (!rdpei_write_2byte_unsignedcxx . . $ rdpei_write_2byte_unsigned(523b43e106360a72).(s, 1)) /* (frameCount) TWO_BYTE_UNSIGNED_INTEGER */
744 goto fail;
745
746 const UINTcxx . . $ UINT# rc = rdpei_write_touch_framecxx . . $ rdpei_write_touch_frame(11c6ef91d4ee74ea).(rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..logcxx . . $ GENERIC_DYNVC_PLUGIN#log., s, frame);
747 if (rc)
748 {
749 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
750 "rdpei_write_touch_frame failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", rc);
751 status = rc;
752 goto fail;
753 }
754
755 Stream_SealLengthcxx . . $ Stream_SealLength(141d0e356bb21ff3).(s);
756
757 status = rdpei_send_pducxx . . $ rdpei_send_pdu(c52496e40d89f963).(callback, s, EVENTID_TOUCHcxx . . $ EVENTID_TOUCH., Stream_Lengthcxx . . $ Stream_Length(ebc7f695a8644dc0).(s));
758 fail:
759 Stream_Freecxx . . $ Stream_Free(31813de2214206e2).(s, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!);
760 return status;
761 }
762
763 /**
764 * Function description
765 *
766 * @return 0 on success, otherwise a Win32 error code
767 */
768 static UINTcxx . . $ UINT# rdpei_recv_sc_ready_pducxx . . $ rdpei_recv_sc_ready_pdu(97904834532b458d).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, wStreamcxx . . $ wStream#* s)
769 {
770 UINT32cxx . . $ UINT32# features = 0;
771 UINT32cxx . . $ UINT32# protocolVersion = 0;
772
773 if (!callback || !callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.)
774 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
775
776 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
777
778 if (!Stream_CheckAndLogRequiredLengthWLogcxx . . $ `winpr/include/winpr/stream.h:143:9`!(rdpei->base.log, s, 4))
779 return ERROR_INVALID_DATAcxx . . $ `winpr/include/winpr/error.h:198:9`!;
780 Stream_Read_UINT32cxx . . $ `winpr/include/winpr/stream.h:683:9`!(s, protocolVersion); /* protocolVersion (4 bytes) */
781
782 if (protocolVersion >= RDPINPUT_PROTOCOL_V300cxx . . $ RDPINPUT_PROTOCOL_V300.)
783 {
784 if (!Stream_CheckAndLogRequiredLengthWLogcxx . . $ `winpr/include/winpr/stream.h:143:9`!(rdpei->base.log, s, 4))
785 return ERROR_INVALID_DATAcxx . . $ `winpr/include/winpr/error.h:198:9`!;
786 }
787
788 if (Stream_GetRemainingLengthcxx . . $ Stream_GetRemainingLength(ebc7f695a8644dc0).(s) >= 4)
789 Stream_Read_UINT32cxx . . $ `winpr/include/winpr/stream.h:683:9`!(s, features);
790
791 if (rdpei->versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version. > protocolVersion)
792 rdpei->versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version. = protocolVersion;
793 rdpei->featurescxx . . $ $anonymous_type_ea19c5b41633425d_0#features. = features;
794
795 if (protocolVersion > RDPINPUT_PROTOCOL_V300cxx . . $ RDPINPUT_PROTOCOL_V300.)
796 {
797 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_WARN,
798 "Unknown [MS-RDPEI] protocolVersion: 0x%08" PRIX32cxx . . $ `<external>/15933738808807975373/inttypes.h:141:10`! "", protocolVersion);
799 }
800
801 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
802 }
803
804 /**
805 * Function description
806 *
807 * @return 0 on success, otherwise a Win32 error code
808 */
809 static UINTcxx . . $ UINT# rdpei_recv_suspend_touch_pducxx . . $ rdpei_recv_suspend_touch_pdu(97904834532b458d).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, wStreamcxx . . $ wStream#* s)
810 {
811 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
812
813 WINPR_UNUSEDcxx . . $ `winpr/include/winpr/platform.h:718:9`!(s);
814
815 if (!callback || !callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.)
816 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
817
818 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
819 RdpeiClientContextcxx . . $ RdpeiClientContext#* context = rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.;
820 if (!rdpei)
821 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
822
823 IFCALLRETcxx . . $ `include/freerdp/api.h:96:9`!(context->SuspendTouch, error, context);
824
825 if (error)
826 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
827 "rdpei->SuspendTouch failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
828
829 return error;
830 }
831
832 /**
833 * Function description
834 *
835 * @return 0 on success, otherwise a Win32 error code
836 */
837 static UINTcxx . . $ UINT# rdpei_recv_resume_touch_pducxx . . $ rdpei_recv_resume_touch_pdu(97904834532b458d).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, wStreamcxx . . $ wStream#* s)
838 {
839 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
840 if (!s || !callback)
841 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
842
843 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
844 if (!rdpei)
845 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
846
847 RdpeiClientContextcxx . . $ RdpeiClientContext#* context = (RdpeiClientContextcxx . . $ RdpeiClientContext#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.->pInterfacecxx . . $ s_IWTSPlugin#pInterface.;
848 if (!context)
849 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
850
851 IFCALLRETcxx . . $ `include/freerdp/api.h:96:9`!(context->ResumeTouch, error, context);
852
853 if (error)
854 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "rdpei->ResumeTouch failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!",
855 error);
856
857 return error;
858 }
859
860 /**
861 * Function description
862 *
863 * @return 0 on success, otherwise a Win32 error code
864 */
865 static UINTcxx . . $ UINT# rdpei_recv_pducxx . . $ rdpei_recv_pdu(97904834532b458d).(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback, wStreamcxx . . $ wStream#* s)
866 {
867 UINT16cxx . . $ UINT16# eventId = 0;
868 UINT32cxx . . $ UINT32# pduLength = 0;
869 UINTcxx . . $ UINT# error = 0;
870
871 if (!callback || !s)
872 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
873
874 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
875 if (!rdpei)
876 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
877
878 if (!Stream_CheckAndLogRequiredLengthWLogcxx . . $ `winpr/include/winpr/stream.h:143:9`!(rdpei->base.log, s, 6))
879 return ERROR_INVALID_DATAcxx . . $ `winpr/include/winpr/error.h:198:9`!;
880
881 Stream_Read_UINT16cxx . . $ `winpr/include/winpr/stream.h:659:9`!(s, eventId); /* eventId (2 bytes) */
882 Stream_Read_UINT32cxx . . $ `winpr/include/winpr/stream.h:683:9`!(s, pduLength); /* pduLength (4 bytes) */
883 #ifdef WITH_DEBUG_RDPEI
884 WLog_Print(rdpei->base.log, WLOG_DEBUG,
885 "rdpei_recv_pdu: eventId: %" PRIu16 " (%s) length: %" PRIu32 "", eventId,
886 rdpei_eventid_string(eventId), pduLength);
887 #endif
888
889 if ((pduLength < 6) || !Stream_CheckAndLogRequiredLengthWLogcxx . . $ `winpr/include/winpr/stream.h:143:9`!(rdpei->base.log, s, pduLength - 6))
890 return ERROR_INVALID_DATAcxx . . $ `winpr/include/winpr/error.h:198:9`!;
891
892 switch (eventId)
893 {
894 case EVENTID_SC_READYcxx . . $ EVENTID_SC_READY.:
895 if ((error = rdpei_recv_sc_ready_pducxx . . $ rdpei_recv_sc_ready_pdu(97904834532b458d).(callback, s)))
896 {
897 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
898 "rdpei_recv_sc_ready_pdu failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
899 return error;
900 }
901
902 if ((error = rdpei_send_cs_ready_pducxx . . $ rdpei_send_cs_ready_pdu(60d8812f7e930a9c).(callback)))
903 {
904 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
905 "rdpei_send_cs_ready_pdu failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
906 return error;
907 }
908
909 break;
910
911 case EVENTID_SUSPEND_TOUCHcxx . . $ EVENTID_SUSPEND_TOUCH.:
912 if ((error = rdpei_recv_suspend_touch_pducxx . . $ rdpei_recv_suspend_touch_pdu(97904834532b458d).(callback, s)))
913 {
914 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
915 "rdpei_recv_suspend_touch_pdu failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
916 return error;
917 }
918
919 break;
920
921 case EVENTID_RESUME_TOUCHcxx . . $ EVENTID_RESUME_TOUCH.:
922 if ((error = rdpei_recv_resume_touch_pducxx . . $ rdpei_recv_resume_touch_pdu(97904834532b458d).(callback, s)))
923 {
924 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
925 "rdpei_recv_resume_touch_pdu failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
926 return error;
927 }
928
929 break;
930
931 default:
932 break;
933 }
934
935 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
936 }
937
938 /**
939 * Function description
940 *
941 * @return 0 on success, otherwise a Win32 error code
942 */
943 static UINTcxx . . $ UINT# rdpei_on_data_receivedcxx . . $ rdpei_on_data_received(7d5bfc0113ae0792).(IWTSVirtualChannelCallbackcxx . . $ IWTSVirtualChannelCallback#* pChannelCallback, wStreamcxx . . $ wStream#* data)
944 {
945 GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback = (GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#*)pChannelCallback;
946 return rdpei_recv_pducxx . . $ rdpei_recv_pdu(97904834532b458d).(callback, data);
947 }
948
949 /**
950 * Function description
951 *
952 * @return 0 on success, otherwise a Win32 error code
953 */
954 static UINTcxx . . $ UINT# rdpei_on_closecxx . . $ rdpei_on_close(291fd05f9f405f8c).(IWTSVirtualChannelCallbackcxx . . $ IWTSVirtualChannelCallback#* pChannelCallback)
955 {
956 GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback = (GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#*)pChannelCallback;
957 if (callback)
958 {
959 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)callback->plugincxx . . $ $anonymous_type_b3a06c54c4b60133_0#plugin.;
960 if (rdpei && rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.)
961 {
962 if (rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.->channel_callbackcxx . . $ $anonymous_type_b3a06c54c4b60133_1#channel_callback. == callback)
963 rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.->channel_callbackcxx . . $ $anonymous_type_b3a06c54c4b60133_1#channel_callback. = nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!;
964 }
965 }
966 freecxx . . $ free(5d22bdacc48458e8).(callback);
967 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
968 }
969
970 /**
971 * Channel Client Interface
972 */
973
974 static UINT32cxx . . $ UINT32# rdpei_get_versioncxx . . $ rdpei_get_version(1aa15a32261634f0).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context)
975 {
976 if (!context || !context->handlecxx . . $ s_rdpei_client_context#handle.)
977 return 0;
978
979 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
980 return rdpei->versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version.;
981 }
982
983 static UINT32cxx . . $ UINT32# rdpei_get_featurescxx . . $ rdpei_get_features(1aa15a32261634f0).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context)
984 {
985 if (!context || !context->handlecxx . . $ s_rdpei_client_context#handle.)
986 return 0;
987
988 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
989 return rdpei->featurescxx . . $ $anonymous_type_ea19c5b41633425d_0#features.;
990 }
991
992 /**
993 * Function description
994 *
995 * @return 0 on success, otherwise a Win32 error code
996 */
997 UINTcxx . . $ UINT# rdpei_send_framecxx . . $ rdpei_send_frame(8fd0fc4ee0a5cd6b).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, RDPINPUT_TOUCH_FRAMEcxx . . $ RDPINPUT_TOUCH_FRAME#* frame)
998 {
999 UINT64cxx . . $ UINT64# currentTime = GetTickCount64cxx . . $ `winpr/include/winpr/sysinfo.h:353:9`!();
1000 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
1001
1002 GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#* callback = rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..listener_callbackcxx . . $ GENERIC_DYNVC_PLUGIN#listener_callback.->channel_callbackcxx . . $ $anonymous_type_b3a06c54c4b60133_1#channel_callback.;
1003
1004 /* Just ignore the event if the channel is not connected */
1005 if (!callback)
1006 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1007
1008 if (!rdpei->previousFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousFrameTime. && !rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime.)
1009 {
1010 rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime. = currentTime;
1011 frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_5#frameOffset. = 0;
1012 }
1013 else
1014 {
1015 rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime. = currentTime;
1016 frame->frameOffsetcxx . . $ $anonymous_type_4af69d5da9134dfb_5#frameOffset. = rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime. - rdpei->previousFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousFrameTime.;
1017 }
1018
1019 const UINTcxx . . $ UINT# error = rdpei_send_touch_event_pducxx . . $ rdpei_send_touch_event_pdu(9cddf9d1dcc1e273).(callback, frame);
1020 if (error)
1021 {
1022 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR,
1023 "rdpei_send_touch_event_pdu failed with error %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`! "!", error);
1024 return error;
1025 }
1026
1027 rdpei->previousFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousFrameTime. = rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime.;
1028 return error;
1029 }
1030
1031 /**
1032 * Function description
1033 *
1034 * @return 0 on success, otherwise a Win32 error code
1035 */
1036 static UINTcxx . . $ UINT# rdpei_add_contactcxx . . $ rdpei_add_contact(dcabf4df9a4a293e).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, const RDPINPUT_CONTACT_DATAcxx . . $ RDPINPUT_CONTACT_DATA#* contact)
1037 {
1038 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1039 if (!context || !contact || !context->handlecxx . . $ s_rdpei_client_context#handle.)
1040 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
1041
1042 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
1043
1044 EnterCriticalSectioncxx . . $ EnterCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1045 RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT#* contactPoint = &rdpei->contactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#contactPoints.[contact->contactIdcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactId.];
1046
1047 if (contactPoint->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#dirty. && contactPoint->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#data..contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. != contact->contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags.)
1048 {
1049 const INT32cxx . . $ INT32# externalId = contactPoint->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#externalId.;
1050 error = rdpei_add_framecxx . . $ rdpei_add_frame(1aa15a32261634f0).(context);
1051 if (!contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active.)
1052 {
1053 contactPoint->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#active. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
1054 contactPoint->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#externalId. = externalId;
1055 contactPoint->contactIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#contactId. = contact->contactIdcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactId.;
1056 }
1057 }
1058
1059 contactPoint->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#data. = *contact;
1060 contactPoint->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#dirty. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
1061 (void)SetEventcxx . . $ SetEvent(dedf1e9b1c614a07).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
1062 LeaveCriticalSectioncxx . . $ LeaveCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1063
1064 return error;
1065 }
1066
1067 static UINTcxx . . $ UINT# rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# contactFlags,
1068 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, INT32cxx . . $ INT32#* contactId, UINT32cxx . . $ UINT32# fieldFlags, va_listcxx . . $ va_list# ap)
1069 {
1070 INT64cxx . . $ INT64# contactIdlocal = -1;
1071 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1072
1073 if (!context || !contactId || !context->handlecxx . . $ s_rdpei_client_context#handle.)
1074 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
1075
1076 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
1077 /* Create a new contact point in an empty slot */
1078 EnterCriticalSectioncxx . . $ EnterCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1079 const BOOLcxx . . $ BOOL# begin = (contactFlags & RDPINPUT_CONTACT_FLAG_DOWNcxx . . $ RDPINPUT_CONTACT_FLAG_DOWN.) != 0;
1080 RDPINPUT_CONTACT_POINTcxx . . $ RDPINPUT_CONTACT_POINT#* contactPoint = rdpei_contactcxx . . $ rdpei_contact(718d6ad0a67c0ba7).(rdpei, externalId, !begin);
1081 if (contactPoint)
1082 contactIdlocal = contactPoint->contactIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_0#contactId.;
1083
1084 if (contactIdlocal > UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:124:10`!)
1085 {
1086 error = ERROR_INVALID_PARAMETERcxx . . $ `winpr/include/winpr/error.h:252:9`!;
1087 goto fail;
1088 }
1089
1090 if (contactIdlocal >= 0)
1091 {
1092 RDPINPUT_CONTACT_DATAcxx . . $ RDPINPUT_CONTACT_DATA# contact = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1093 contact.xcxx . . $ $anonymous_type_4af69d5da9134dfb_4#x. = x;
1094 contact.ycxx . . $ $anonymous_type_4af69d5da9134dfb_4#y. = y;
1095 contact.contactIdcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactId. = (UINT32cxx . . $ UINT32#)contactIdlocal;
1096 contact.contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactFlags. = contactFlags;
1097 contact.fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_4#fieldsPresent. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(UINT16, fieldFlags);
1098
1099 if (fieldFlags & CONTACT_DATA_CONTACTRECT_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:63:9`!)
1100 {
1101 INT32cxx . . $ INT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1102 contact.contactRectLeftcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectLeft. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1103
1104 val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1105 contact.contactRectTopcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectTop. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1106
1107 val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1108 contact.contactRectRightcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectRight. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1109
1110 val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1111 contact.contactRectBottomcxx . . $ $anonymous_type_4af69d5da9134dfb_4#contactRectBottom. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1112 }
1113 if (fieldFlags & CONTACT_DATA_ORIENTATION_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:64:9`!)
1114 {
1115 UINT32cxx . . $ UINT32# p = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, UINT32);
1116 if (p >= 360)
1117 {
1118 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_WARN,
1119 "TouchContact %" PRId64cxx . . $ `<external>/15933738808807975373/inttypes.h:62:10`! ": Invalid orientation value %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`!
1120 "degree, clamping to 359 degree",
1121 contactIdlocal, p);
1122 p = 359;
1123 }
1124 contact.orientationcxx . . $ $anonymous_type_4af69d5da9134dfb_4#orientation. = p;
1125 }
1126 if (fieldFlags & CONTACT_DATA_PRESSURE_PRESENTcxx . . $ `include/freerdp/channels/rdpei.h:65:9`!)
1127 {
1128 UINT32cxx . . $ UINT32# p = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, UINT32);
1129 if (p > 1024)
1130 {
1131 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_WARN,
1132 "TouchContact %" PRId64cxx . . $ `<external>/15933738808807975373/inttypes.h:62:10`! ": Invalid pressure value %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:109:10`!
1133 ", clamping to 1024",
1134 contactIdlocal, p);
1135 p = 1024;
1136 }
1137 contact.pressurecxx . . $ $anonymous_type_4af69d5da9134dfb_4#pressure. = p;
1138 }
1139
1140 error = context->AddContactcxx . . $ s_rdpei_client_context#AddContact.(context, &contact);
1141 }
1142
1143 fail:
1144 if (contactId)
1145 *contactId = (INT32cxx . . $ INT32#)contactIdlocal;
1146
1147 LeaveCriticalSectioncxx . . $ LeaveCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1148 return error;
1149 }
1150
1151 /**
1152 * Function description
1153 *
1154 * @return 0 on success, otherwise a Win32 error code
1155 */
1156 static UINTcxx . . $ UINT# rdpei_touch_begincxx . . $ rdpei_touch_begin(781ba2cd78738797).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1157 INT32cxx . . $ INT32#* contactId)
1158 {
1159 UINTcxx . . $ UINT# rc = 0;
1160 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1161 rc = rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId,
1162 RDPINPUT_CONTACT_FLAG_DOWNcxx . . $ RDPINPUT_CONTACT_FLAG_DOWN. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE. |
1163 RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.,
1164 x, y, contactId, 0, ap);
1165 return rc;
1166 }
1167
1168 /**
1169 * Function description
1170 *
1171 * @return 0 on success, otherwise a Win32 error code
1172 */
1173 static UINTcxx . . $ UINT# rdpei_touch_updatecxx . . $ rdpei_touch_update(781ba2cd78738797).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1174 INT32cxx . . $ INT32#* contactId)
1175 {
1176 UINTcxx . . $ UINT# rc = 0;
1177 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1178 rc = rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId,
1179 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE. |
1180 RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.,
1181 x, y, contactId, 0, ap);
1182 return rc;
1183 }
1184
1185 /**
1186 * Function description
1187 *
1188 * @return 0 on success, otherwise a Win32 error code
1189 */
1190 static UINTcxx . . $ UINT# rdpei_touch_endcxx . . $ rdpei_touch_end(781ba2cd78738797).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1191 INT32cxx . . $ INT32#* contactId)
1192 {
1193 UINTcxx . . $ UINT# error = 0;
1194 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1195 error = rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId,
1196 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE. |
1197 RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.,
1198 x, y, contactId, 0, ap);
1199 if (error != CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!)
1200 return error;
1201 error =
1202 rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId, RDPINPUT_CONTACT_FLAG_UPcxx . . $ RDPINPUT_CONTACT_FLAG_UP., x, y, contactId, 0, ap);
1203 return error;
1204 }
1205
1206 /**
1207 * Function description
1208 *
1209 * @return 0 on success, otherwise a Win32 error code
1210 */
1211 static UINTcxx . . $ UINT# rdpei_touch_cancelcxx . . $ rdpei_touch_cancel(781ba2cd78738797).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1212 INT32cxx . . $ INT32#* contactId)
1213 {
1214 UINTcxx . . $ UINT# rc = 0;
1215 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1216 rc = rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId,
1217 RDPINPUT_CONTACT_FLAG_UPcxx . . $ RDPINPUT_CONTACT_FLAG_UP. | RDPINPUT_CONTACT_FLAG_CANCELEDcxx . . $ RDPINPUT_CONTACT_FLAG_CANCELED., x, y,
1218 contactId, 0, ap);
1219 return rc;
1220 }
1221
1222 static UINTcxx . . $ UINT# rdpei_touch_raw_eventcxx . . $ rdpei_touch_raw_event(abaeb8fa82662e61).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1223 INT32cxx . . $ INT32#* contactId, UINT32cxx . . $ UINT32# flags, UINT32cxx . . $ UINT32# fieldFlags, ...)
1224 {
1225 UINTcxx . . $ UINT# rc = 0;
1226 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1227 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, fieldFlags);
1228 rc = rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId, flags, x, y, contactId, fieldFlags, ap);
1229 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1230 return rc;
1231 }
1232
1233 static UINTcxx . . $ UINT# rdpei_touch_raw_event_vacxx . . $ rdpei_touch_raw_event_va(44be9b8164066969).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, INT32cxx . . $ INT32# x,
1234 INT32cxx . . $ INT32# y, INT32cxx . . $ INT32#* contactId, UINT32cxx . . $ UINT32# flags, UINT32cxx . . $ UINT32# fieldFlags,
1235 va_listcxx . . $ va_list# args)
1236 {
1237 return rdpei_touch_processcxx . . $ rdpei_touch_process(31340908fe6225ca).(context, externalId, flags, x, y, contactId, fieldFlags, args);
1238 }
1239
1240 static RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT#* rdpei_pen_contactcxx . . $ rdpei_pen_contact(1d4e305aa4ed580c).(RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei, INT32cxx . . $ INT32# externalId,
1241 BOOLcxx . . $ BOOL# active)
1242 {
1243 if (!rdpei)
1244 return nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!;
1245
1246 for (UINT32cxx . . $ UINT32# x = 0; x < rdpei->maxPenContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxPenContacts.; x++)
1247 {
1248 RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT#* contact = &rdpei->penContactPointscxx . . $ $anonymous_type_ea19c5b41633425d_0#penContactPoints.[x];
1249 if (active)
1250 {
1251 if (contact->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#active.)
1252 {
1253 if (contact->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#externalId. == externalId)
1254 return contact;
1255 }
1256 }
1257 else
1258 {
1259 if (!contact->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#active.)
1260 {
1261 contact->externalIdcxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#externalId. = externalId;
1262 contact->activecxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#active. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
1263 return contact;
1264 }
1265 }
1266 }
1267 return nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!;
1268 }
1269
1270 static UINTcxx . . $ UINT# rdpei_add_pencxx . . $ rdpei_add_pen(849a3de46a4bbe06).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId,
1271 const RDPINPUT_PEN_CONTACTcxx . . $ RDPINPUT_PEN_CONTACT#* contact)
1272 {
1273 if (!context || !contact || !context->handlecxx . . $ s_rdpei_client_context#handle.)
1274 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
1275
1276 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
1277
1278 EnterCriticalSectioncxx . . $ EnterCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1279
1280 RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT#* contactPoint = rdpei_pen_contactcxx . . $ rdpei_pen_contact(1d4e305aa4ed580c).(rdpei, externalId, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!);
1281 if (contactPoint)
1282 {
1283 contactPoint->datacxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#data. = *contact;
1284 contactPoint->dirtycxx . . $ $anonymous_type_ca7bf2dfc87d04a7_1#dirty. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
1285 (void)SetEventcxx . . $ SetEvent(dedf1e9b1c614a07).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
1286 }
1287
1288 LeaveCriticalSectioncxx . . $ LeaveCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1289
1290 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1291 }
1292
1293 static UINTcxx . . $ UINT# rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# contactFlags,
1294 UINT32cxx . . $ UINT32# fieldFlags, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, va_listcxx . . $ va_list# ap)
1295 {
1296 RDPINPUT_PEN_CONTACT_POINTcxx . . $ RDPINPUT_PEN_CONTACT_POINT#* contactPoint = nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!;
1297 UINTcxx . . $ UINT# error = CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1298
1299 if (!context || !context->handlecxx . . $ s_rdpei_client_context#handle.)
1300 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
1301
1302 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)context->handlecxx . . $ s_rdpei_client_context#handle.;
1303
1304 EnterCriticalSectioncxx . . $ EnterCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1305 // Start a new contact only when it is not active.
1306 contactPoint = rdpei_pen_contactcxx . . $ rdpei_pen_contact(1d4e305aa4ed580c).(rdpei, externalId, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!);
1307 if (!contactPoint)
1308 {
1309 const UINT32cxx . . $ UINT32# mask = RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE.;
1310 if ((contactFlags & mask) == mask)
1311 {
1312 contactPoint = rdpei_pen_contactcxx . . $ rdpei_pen_contact(1d4e305aa4ed580c).(rdpei, externalId, FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!);
1313 }
1314 }
1315
1316 if (contactPoint != nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!)
1317 {
1318 RDPINPUT_PEN_CONTACTcxx . . $ RDPINPUT_PEN_CONTACT# contact = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1319
1320 contact.xcxx . . $ $anonymous_type_4af69d5da9134dfb_7#x. = x;
1321 contact.ycxx . . $ $anonymous_type_4af69d5da9134dfb_7#y. = y;
1322 contact.fieldsPresentcxx . . $ $anonymous_type_4af69d5da9134dfb_7#fieldsPresent. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(UINT16, fieldFlags);
1323
1324 contact.contactFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#contactFlags. = contactFlags;
1325 if (fieldFlags & RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT.)
1326 {
1327 const UINT32cxx . . $ UINT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, UINT32);
1328 contact.penFlagscxx . . $ $anonymous_type_4af69d5da9134dfb_7#penFlags. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(UINT16, val);
1329 }
1330 if (fieldFlags & RDPINPUT_PEN_CONTACT_PRESSURE_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT.)
1331 {
1332 const UINT32cxx . . $ UINT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, UINT32);
1333 contact.pressurecxx . . $ $anonymous_type_4af69d5da9134dfb_7#pressure. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(UINT16, val);
1334 }
1335 if (fieldFlags & RDPINPUT_PEN_CONTACT_ROTATION_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_ROTATION_PRESENT.)
1336 {
1337 const UINT32cxx . . $ UINT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, UINT32);
1338 contact.rotationcxx . . $ $anonymous_type_4af69d5da9134dfb_7#rotation. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(UINT16, val);
1339 }
1340 if (fieldFlags & RDPINPUT_PEN_CONTACT_TILTX_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_TILTX_PRESENT.)
1341 {
1342 const INT32cxx . . $ INT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1343 contact.tiltXcxx . . $ $anonymous_type_4af69d5da9134dfb_7#tiltX. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1344 }
1345 if (fieldFlags & RDPINPUT_PEN_CONTACT_TILTY_PRESENTcxx . . $ RDPINPUT_PEN_CONTACT_TILTY_PRESENT.)
1346 {
1347 const INT32cxx . . $ INT32# val = va_argcxx . . $ `<external>/8293021631987149590/stdarg.h:54:9`!(ap, INT32);
1348 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!((val >= INT16_MINcxx . . $ `<external>/3415975807581488833/stdint.h:112:10`!) && (val <= INT16_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:117:10`!));
1349 contact.tiltYcxx . . $ $anonymous_type_4af69d5da9134dfb_7#tiltY. = WINPR_ASSERTING_INT_CASTcxx . . $ `winpr/include/winpr/cast.h:111:9`!(INT16, val);
1350 }
1351
1352 error = context->AddPencxx . . $ s_rdpei_client_context#AddPen.(context, externalId, &contact);
1353 }
1354
1355 LeaveCriticalSectioncxx . . $ LeaveCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1356
1357 return error;
1358 }
1359
1360 /**
1361 * Function description
1362 *
1363 * @return 0 on success, otherwise a Win32 error code
1364 */
1365 static UINTcxx . . $ UINT# rdpei_pen_begincxx . . $ rdpei_pen_begin(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags,
1366 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1367 {
1368 UINTcxx . . $ UINT# error = 0;
1369 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1370
1371 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1372 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1373 RDPINPUT_CONTACT_FLAG_DOWNcxx . . $ RDPINPUT_CONTACT_FLAG_DOWN. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE. |
1374 RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.,
1375 fieldFlags, x, y, ap);
1376 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1377
1378 return error;
1379 }
1380
1381 /**
1382 * Function description
1383 *
1384 * @return 0 on success, otherwise a Win32 error code
1385 */
1386 static UINTcxx . . $ UINT# rdpei_pen_updatecxx . . $ rdpei_pen_update(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags,
1387 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1388 {
1389 UINTcxx . . $ UINT# error = 0;
1390 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1391
1392 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1393 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1394 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE. |
1395 RDPINPUT_CONTACT_FLAG_INCONTACTcxx . . $ RDPINPUT_CONTACT_FLAG_INCONTACT.,
1396 fieldFlags, x, y, ap);
1397 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1398 return error;
1399 }
1400
1401 /**
1402 * Function description
1403 *
1404 * @return 0 on success, otherwise a Win32 error code
1405 */
1406 static UINTcxx . . $ UINT# rdpei_pen_endcxx . . $ rdpei_pen_end(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags, INT32cxx . . $ INT32# x,
1407 INT32cxx . . $ INT32# y, ...)
1408 {
1409 UINTcxx . . $ UINT# error = 0;
1410 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1411 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1412 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1413 RDPINPUT_CONTACT_FLAG_UPcxx . . $ RDPINPUT_CONTACT_FLAG_UP. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE., fieldFlags,
1414 x, y, ap);
1415 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1416 return error;
1417 }
1418
1419 /**
1420 * Function description
1421 *
1422 * @return 0 on success, otherwise a Win32 error code
1423 */
1424 static UINTcxx . . $ UINT# rdpei_pen_hover_begincxx . . $ rdpei_pen_hover_begin(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags,
1425 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1426 {
1427 UINTcxx . . $ UINT# error = 0;
1428 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1429
1430 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1431 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1432 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE.,
1433 fieldFlags, x, y, ap);
1434 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1435
1436 return error;
1437 }
1438
1439 /**
1440 * Function description
1441 *
1442 * @return 0 on success, otherwise a Win32 error code
1443 */
1444 static UINTcxx . . $ UINT# rdpei_pen_hover_updatecxx . . $ rdpei_pen_hover_update(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags,
1445 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1446 {
1447 UINTcxx . . $ UINT# error = 0;
1448 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1449
1450 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1451 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1452 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_INRANGEcxx . . $ RDPINPUT_CONTACT_FLAG_INRANGE.,
1453 fieldFlags, x, y, ap);
1454 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1455
1456 return error;
1457 }
1458
1459 /**
1460 * Function description
1461 *
1462 * @return 0 on success, otherwise a Win32 error code
1463 */
1464 static UINTcxx . . $ UINT# rdpei_pen_hover_cancelcxx . . $ rdpei_pen_hover_cancel(d356c23338f17590).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# fieldFlags,
1465 INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1466 {
1467 UINTcxx . . $ UINT# error = 0;
1468 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1469
1470 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1471 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId,
1472 RDPINPUT_CONTACT_FLAG_UPDATEcxx . . $ RDPINPUT_CONTACT_FLAG_UPDATE. | RDPINPUT_CONTACT_FLAG_CANCELEDcxx . . $ RDPINPUT_CONTACT_FLAG_CANCELED.,
1473 fieldFlags, x, y, ap);
1474 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1475
1476 return error;
1477 }
1478
1479 static UINTcxx . . $ UINT# rdpei_pen_raw_eventcxx . . $ rdpei_pen_raw_event(1cb72d49dab2f314).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId, UINT32cxx . . $ UINT32# contactFlags,
1480 UINT32cxx . . $ UINT32# fieldFlags, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y, ...)
1481 {
1482 UINTcxx . . $ UINT# error = 0;
1483 va_listcxx . . $ va_list# ap = WINPR_C_ARRAY_INITcxx . . $ `winpr/include/winpr/platform.h:87:9`!;
1484
1485 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(ap, y);
1486 error = rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId, contactFlags, fieldFlags, x, y, ap);
1487 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(ap);
1488 return error;
1489 }
1490
1491 static UINTcxx . . $ UINT# rdpei_pen_raw_event_vacxx . . $ rdpei_pen_raw_event_va(d6b1bcc7e6966b4c).(RdpeiClientContextcxx . . $ RdpeiClientContext#* context, INT32cxx . . $ INT32# externalId,
1492 UINT32cxx . . $ UINT32# contactFlags, UINT32cxx . . $ UINT32# fieldFlags, INT32cxx . . $ INT32# x, INT32cxx . . $ INT32# y,
1493 va_listcxx . . $ va_list# args)
1494 {
1495 return rdpei_pen_processcxx . . $ rdpei_pen_process(d6b1bcc7e6966b4c).(context, externalId, contactFlags, fieldFlags, x, y, args);
1496 }
1497
1498 static UINTcxx . . $ UINT# init_plugin_cbcxx . . $ init_plugin_cb(3cab3412d5031a14).(GENERIC_DYNVC_PLUGINcxx . . $ GENERIC_DYNVC_PLUGIN#* base, rdpContextcxx . . $ rdpContext#* rcontext, rdpSettingscxx . . $ rdpSettings#* settings)
1499 {
1500 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)base;
1501
1502 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(base);
1503 WINPR_UNUSEDcxx . . $ `winpr/include/winpr/platform.h:718:9`!(settings);
1504
1505 rdpei->versioncxx . . $ $anonymous_type_ea19c5b41633425d_0#version. = RDPINPUT_PROTOCOL_V300cxx . . $ RDPINPUT_PROTOCOL_V300.;
1506 rdpei->currentFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#currentFrameTime. = 0;
1507 rdpei->previousFrameTimecxx . . $ $anonymous_type_ea19c5b41633425d_0#previousFrameTime. = 0;
1508 rdpei->maxTouchContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxTouchContacts. = MAX_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:68:9`!;
1509 rdpei->maxPenContactscxx . . $ $anonymous_type_ea19c5b41633425d_0#maxPenContacts. = MAX_PEN_CONTACTScxx . . $ `channels/rdpei/client/rdpei_main.c:69:9`!;
1510 rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext. = rcontext;
1511
1512 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(rdpei->base.log);
1513
1514 InitializeCriticalSectioncxx . . $ InitializeCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1515 rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event. = CreateEventAcxx . . $ CreateEventA(4af70616341fa7ab).(nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!, FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!, nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!);
1516 if (!rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.)
1517 {
1518 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "calloc failed!");
1519 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
1520 }
1521
1522 RdpeiClientContextcxx . . $ RdpeiClientContext#* context = (RdpeiClientContextcxx . . $ RdpeiClientContext#*)calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(RdpeiClientContextcxx . . $ RdpeiClientContext#));
1523 if (!context)
1524 {
1525 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "calloc failed!");
1526 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
1527 }
1528
1529 context->clientFeaturesMaskcxx . . $ s_rdpei_client_context#clientFeaturesMask. = UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:124:10`!;
1530 context->handlecxx . . $ s_rdpei_client_context#handle. = (void*)rdpei;
1531 context->GetVersioncxx . . $ s_rdpei_client_context#GetVersion. = rdpei_get_versioncxx . . $ rdpei_get_version(1aa15a32261634f0).;
1532 context->GetFeaturescxx . . $ s_rdpei_client_context#GetFeatures. = rdpei_get_featurescxx . . $ rdpei_get_features(1aa15a32261634f0).;
1533 context->AddContactcxx . . $ s_rdpei_client_context#AddContact. = rdpei_add_contactcxx . . $ rdpei_add_contact(dcabf4df9a4a293e).;
1534 context->TouchBegincxx . . $ s_rdpei_client_context#TouchBegin. = rdpei_touch_begincxx . . $ rdpei_touch_begin(781ba2cd78738797).;
1535 context->TouchUpdatecxx . . $ s_rdpei_client_context#TouchUpdate. = rdpei_touch_updatecxx . . $ rdpei_touch_update(781ba2cd78738797).;
1536 context->TouchEndcxx . . $ s_rdpei_client_context#TouchEnd. = rdpei_touch_endcxx . . $ rdpei_touch_end(781ba2cd78738797).;
1537 context->TouchCancelcxx . . $ s_rdpei_client_context#TouchCancel. = rdpei_touch_cancelcxx . . $ rdpei_touch_cancel(781ba2cd78738797).;
1538 context->TouchRawEventcxx . . $ s_rdpei_client_context#TouchRawEvent. = rdpei_touch_raw_eventcxx . . $ rdpei_touch_raw_event(abaeb8fa82662e61).;
1539 context->TouchRawEventVAcxx . . $ s_rdpei_client_context#TouchRawEventVA. = rdpei_touch_raw_event_vacxx . . $ rdpei_touch_raw_event_va(44be9b8164066969).;
1540 context->AddPencxx . . $ s_rdpei_client_context#AddPen. = rdpei_add_pencxx . . $ rdpei_add_pen(849a3de46a4bbe06).;
1541 context->PenBegincxx . . $ s_rdpei_client_context#PenBegin. = rdpei_pen_begincxx . . $ rdpei_pen_begin(d356c23338f17590).;
1542 context->PenUpdatecxx . . $ s_rdpei_client_context#PenUpdate. = rdpei_pen_updatecxx . . $ rdpei_pen_update(d356c23338f17590).;
1543 context->PenEndcxx . . $ s_rdpei_client_context#PenEnd. = rdpei_pen_endcxx . . $ rdpei_pen_end(d356c23338f17590).;
1544 context->PenHoverBegincxx . . $ s_rdpei_client_context#PenHoverBegin. = rdpei_pen_hover_begincxx . . $ rdpei_pen_hover_begin(d356c23338f17590).;
1545 context->PenHoverUpdatecxx . . $ s_rdpei_client_context#PenHoverUpdate. = rdpei_pen_hover_updatecxx . . $ rdpei_pen_hover_update(d356c23338f17590).;
1546 context->PenHoverCancelcxx . . $ s_rdpei_client_context#PenHoverCancel. = rdpei_pen_hover_cancelcxx . . $ rdpei_pen_hover_cancel(d356c23338f17590).;
1547 context->PenRawEventcxx . . $ s_rdpei_client_context#PenRawEvent. = rdpei_pen_raw_eventcxx . . $ rdpei_pen_raw_event(1cb72d49dab2f314).;
1548 context->PenRawEventVAcxx . . $ s_rdpei_client_context#PenRawEventVA. = rdpei_pen_raw_event_vacxx . . $ rdpei_pen_raw_event_va(d6b1bcc7e6966b4c).;
1549
1550 rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context. = context;
1551 rdpei->basecxx . . $ $anonymous_type_ea19c5b41633425d_0#base..ifacecxx . . $ GENERIC_DYNVC_PLUGIN#iface..pInterfacecxx . . $ s_IWTSPlugin#pInterface. = (void*)context;
1552
1553 rdpei->asynccxx . . $ $anonymous_type_ea19c5b41633425d_0#async. =
1554 !freerdp_settings_get_boolcxx . . $ freerdp_settings_get_bool(c2a3b7001458211).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.->settingscxx . . $ rdp_context#settings., FreeRDP_SynchronousDynamicChannelscxx . . $ FreeRDP_SynchronousDynamicChannels.);
1555 if (rdpei->asynccxx . . $ $anonymous_type_ea19c5b41633425d_0#async.)
1556 {
1557 rdpei->runningcxx . . $ $anonymous_type_ea19c5b41633425d_0#running. = TRUEcxx . . $ `winpr/include/winpr/wtypes.h:126:9`!;
1558
1559 rdpei->threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread. = CreateThreadcxx . . $ CreateThread(b708535bf8f563fd).(nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, 0, rdpei_periodic_updatecxx . . $ rdpei_periodic_update(6769d0e399bf81e3)., rdpei, 0, nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!);
1560 if (!rdpei->threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread.)
1561 {
1562 WLog_Printcxx . . $ `winpr/include/winpr/wlog.h:256:9`!(rdpei->base.log, WLOG_ERROR, "calloc failed!");
1563 return CHANNEL_RC_NO_MEMORYcxx . . $ `winpr/include/winpr/wtsapi.h:171:9`!;
1564 }
1565 }
1566 else
1567 {
1568 if (!freerdp_client_channel_registercxx . . $ freerdp_client_channel_register(7daed36853005fe6).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.->channelscxx . . $ rdp_context#channels., rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.,
1569 rdpei_poll_runcxx . . $ rdpei_poll_run(b5c4d77fcfed236e)., rdpei))
1570 return ERROR_INTERNAL_ERRORcxx . . $ `winpr/include/winpr/error.h:985:9`!;
1571 }
1572
1573 return CHANNEL_RC_OKcxx . . $ `winpr/include/winpr/wtsapi.h:159:9`!;
1574 }
1575
1576 static void terminate_plugin_cbcxx . . $ terminate_plugin_cb(86dbf6fc281ca52).(GENERIC_DYNVC_PLUGINcxx . . $ GENERIC_DYNVC_PLUGIN#* base)
1577 {
1578 RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#* rdpei = (RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#*)base;
1579 WINPR_ASSERTcxx . . $ `winpr/include/winpr/assert-api.h:76:9`!(rdpei);
1580
1581 rdpei->runningcxx . . $ $anonymous_type_ea19c5b41633425d_0#running. = FALSEcxx . . $ `winpr/include/winpr/wtypes.h:122:9`!;
1582 if (rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.)
1583 (void)SetEventcxx . . $ SetEvent(dedf1e9b1c614a07).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
1584
1585 if (rdpei->threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread.)
1586 {
1587 (void)WaitForSingleObjectcxx . . $ WaitForSingleObject(35feec062aeef876).(rdpei->threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread., INFINITEcxx . . $ `winpr/include/winpr/synch.h:212:9`!);
1588 (void)CloseHandlecxx . . $ CloseHandle(dedf1e9b1c614a07).(rdpei->threadcxx . . $ $anonymous_type_ea19c5b41633425d_0#thread.);
1589 }
1590
1591 if (rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event. && !rdpei->asynccxx . . $ $anonymous_type_ea19c5b41633425d_0#async.)
1592 freerdp_client_channel_unregistercxx . . $ freerdp_client_channel_unregister(696732c1718f3b96).(rdpei->rdpcontextcxx . . $ $anonymous_type_ea19c5b41633425d_0#rdpcontext.->channelscxx . . $ rdp_context#channels., rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
1593
1594 if (rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.)
1595 (void)CloseHandlecxx . . $ CloseHandle(dedf1e9b1c614a07).(rdpei->eventcxx . . $ $anonymous_type_ea19c5b41633425d_0#event.);
1596
1597 DeleteCriticalSectioncxx . . $ DeleteCriticalSection(648035eaeaf99ce5).(&rdpei->lockcxx . . $ $anonymous_type_ea19c5b41633425d_0#lock.);
1598 freecxx . . $ free(5d22bdacc48458e8).(rdpei->contextcxx . . $ $anonymous_type_ea19c5b41633425d_0#context.);
1599 }
1600
1601 static const IWTSVirtualChannelCallbackcxx . . $ IWTSVirtualChannelCallback# rdpei_callbackscxx . . $ rdpei_callbacks. = { rdpei_on_data_receivedcxx . . $ rdpei_on_data_received(7d5bfc0113ae0792).,
1602 nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`!, /* Open */
1603 rdpei_on_closecxx . . $ rdpei_on_close(291fd05f9f405f8c)., nullptrcxx . . $ `winpr/include/winpr/platform.h:88:9`! };
1604
1605 /**
1606 * Function description
1607 *
1608 * @return 0 on success, otherwise a Win32 error code
1609 */
1610 FREERDP_ENTRY_POINTcxx . . $ `include/freerdp/api.h:30:9`!(UINT VCAPITYPEcxx . . $ `winpr/include/winpr/wtsapi.h:120:9`! rdpei_DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints))
1611 {
1612 return freerdp_generic_DVCPluginEntrycxx . . $ freerdp_generic_DVCPluginEntry(ffdc37323ba6388d).(pEntryPoints, RDPEI_TAGcxx . . $ `channels/rdpei/client/rdpei_main.c:46:9`!, RDPEI_DVC_CHANNEL_NAMEcxx . . $ `include/freerdp/channels/rdpei.h:43:9`!,
1613 sizeof(RDPEI_PLUGINcxx . . $ RDPEI_PLUGIN#), sizeof(GENERIC_CHANNEL_CALLBACKcxx . . $ GENERIC_CHANNEL_CALLBACK#),
1614 &rdpei_callbackscxx . . $ rdpei_callbacks., init_plugin_cbcxx . . $ init_plugin_cb(3cab3412d5031a14)., terminate_plugin_cbcxx . . $ terminate_plugin_cb(86dbf6fc281ca52).);
1615 }