[client,common] Fix freerdp_client_register_pen

Pass null device id rather than `deviceid` to find an empty pen device
slot.
This commit is contained in:
Hodol Han 2023-08-03 20:49:14 +09:00 committed by akallabeth
parent fb406feb33
commit 5d61ab1eac

View File

@ -1887,6 +1887,8 @@ static FreeRDP_PenDevice* freerdp_client_get_pen(rdpClientContext* cctx, INT32 d
static BOOL freerdp_client_register_pen(rdpClientContext* cctx, UINT32 flags, INT32 deviceid, static BOOL freerdp_client_register_pen(rdpClientContext* cctx, UINT32 flags, INT32 deviceid,
double pressure) double pressure)
{ {
static const INT32 null_deviceid = 0;
WINPR_ASSERT(cctx); WINPR_ASSERT(cctx);
WINPR_ASSERT((flags & FREERDP_PEN_REGISTER) != 0); WINPR_ASSERT((flags & FREERDP_PEN_REGISTER) != 0);
if (freerdp_client_is_pen(cctx, deviceid)) if (freerdp_client_is_pen(cctx, deviceid))
@ -1896,7 +1898,7 @@ static BOOL freerdp_client_register_pen(rdpClientContext* cctx, UINT32 flags, IN
} }
size_t pos = 0; size_t pos = 0;
FreeRDP_PenDevice* pen = freerdp_client_get_pen(cctx, deviceid, &pos); FreeRDP_PenDevice* pen = freerdp_client_get_pen(cctx, null_deviceid, &pos);
if (pen) if (pen)
{ {
const FreeRDP_PenDevice empty = { 0 }; const FreeRDP_PenDevice empty = { 0 };