From 4df9e30604815c89524fa336782b262aa24e8500 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 13 Feb 2025 15:35:00 +0100 Subject: [PATCH] [proxy,channels] fix return values and sign conversions --- server/proxy/channels/pf_channel_drdynvc.c | 2 +- server/proxy/channels/pf_channel_smartcard.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/proxy/channels/pf_channel_drdynvc.c b/server/proxy/channels/pf_channel_drdynvc.c index 2a1a3d0a6..c8dd9c957 100644 --- a/server/proxy/channels/pf_channel_drdynvc.c +++ b/server/proxy/channels/pf_channel_drdynvc.c @@ -631,7 +631,7 @@ static DynChannelContext* DynChannelContext_new(proxyData* pdata, { DynChannelContext* dyn = calloc(1, sizeof(DynChannelContext)); if (!dyn) - return FALSE; + return NULL; dyn->log = WLog_Get(DTAG); WINPR_ASSERT(dyn->log); diff --git a/server/proxy/channels/pf_channel_smartcard.c b/server/proxy/channels/pf_channel_smartcard.c index 1d2bdfe6b..8cbccb177 100644 --- a/server/proxy/channels/pf_channel_smartcard.c +++ b/server/proxy/channels/pf_channel_smartcard.c @@ -72,7 +72,7 @@ static pf_channel_client_context* scard_get_client_context(pClientContext* pc) } static BOOL pf_channel_client_write_iostatus(wStream* out, const SMARTCARD_OPERATION* op, - UINT32 ioStatus) + NTSTATUS ioStatus) { UINT16 component = 0; UINT16 packetid = 0; @@ -99,7 +99,7 @@ static BOOL pf_channel_client_write_iostatus(wStream* out, const SMARTCARD_OPERA WINPR_ASSERT(dID == op->deviceID); WINPR_ASSERT(cID == op->completionID); - Stream_Write_UINT32(out, ioStatus); + Stream_Write_INT32(out, ioStatus); Stream_SetPosition(out, pos); return TRUE; } @@ -118,7 +118,7 @@ static VOID irp_thread(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_WORK W struct thread_arg* arg = Context; pf_channel_client_context* scard = arg->scard; { - UINT32 ioStatus = 0; + NTSTATUS ioStatus = 0; LONG rc = smartcard_irp_device_control_call(arg->scard->callctx, arg->e->out, &ioStatus, &arg->e->op); if (rc == CHANNEL_RC_OK) @@ -166,7 +166,7 @@ BOOL pf_channel_smartcard_client_handle(wLog* log, pClientContext* pc, wStream* LONG status = 0; UINT32 FileId = 0; UINT32 CompletionId = 0; - UINT32 ioStatus = 0; + NTSTATUS ioStatus = 0; pf_channel_client_queue_element e = { 0 }; pf_channel_client_context* scard = scard_get_client_context(pc);