mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[collections] fix ListDictionary usage
This commit is contained in:
committed by
Martin Fleisz
parent
1f3f3682cc
commit
bd7f0ecd24
@@ -181,7 +181,8 @@ static BOOL rdpdr_server_enqueue_irp(RdpdrServerContext* context, RDPDR_IRP* irp
|
||||
{
|
||||
WINPR_ASSERT(context);
|
||||
WINPR_ASSERT(context->priv);
|
||||
return ListDictionary_Add(context->priv->IrpList, (void*)(size_t)irp->CompletionId, irp);
|
||||
const uintptr_t key = irp->CompletionId + 1ull;
|
||||
return ListDictionary_Add(context->priv->IrpList, (void*)key, irp);
|
||||
}
|
||||
|
||||
static RDPDR_IRP* rdpdr_server_dequeue_irp(RdpdrServerContext* context, UINT32 completionId)
|
||||
@@ -189,7 +190,9 @@ static RDPDR_IRP* rdpdr_server_dequeue_irp(RdpdrServerContext* context, UINT32 c
|
||||
RDPDR_IRP* irp;
|
||||
WINPR_ASSERT(context);
|
||||
WINPR_ASSERT(context->priv);
|
||||
irp = (RDPDR_IRP*)ListDictionary_Take(context->priv->IrpList, (void*)(size_t)completionId);
|
||||
|
||||
const uintptr_t key = completionId + 1ull;
|
||||
irp = (RDPDR_IRP*)ListDictionary_Take(context->priv->IrpList, (void*)key);
|
||||
return irp;
|
||||
}
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp)
|
||||
* FIXME: behavior documented somewhere? behavior not yet
|
||||
* observed with FreeRDP).
|
||||
*/
|
||||
key = irp->CompletionId;
|
||||
key = irp->CompletionId + 1ull;
|
||||
previousIrpThread = ListDictionary_GetItemValue(serial->IrpThreads, (void*)key);
|
||||
|
||||
if (previousIrpThread)
|
||||
@@ -646,7 +646,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp)
|
||||
goto error_handle;
|
||||
}
|
||||
|
||||
key = irp->CompletionId;
|
||||
key = irp->CompletionId + 1ull;
|
||||
|
||||
if (!ListDictionary_Add(serial->IrpThreads, (void*)key, irpThread))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user