[winpr,collections] ListDictionary_GetKeys

This commit is contained in:
akallabeth
2023-06-27 09:32:00 +02:00
committed by akallabeth
parent ac39e8aac2
commit 63d4da2d0d
5 changed files with 22 additions and 27 deletions

View File

@@ -531,11 +531,10 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp)
/* Cleaning up termitating and pending irp
* threads. See also: irp_thread_func() */
HANDLE cirpThread;
ULONG_PTR* ids;
int i, nbIds;
nbIds = ListDictionary_GetKeys(serial->IrpThreads, &ids);
ULONG_PTR* ids = NULL;
const size_t nbIds = ListDictionary_GetKeys(serial->IrpThreads, &ids);
for (i = 0; i < nbIds; i++)
for (size_t i = 0; i < nbIds; i++)
{
/* Checking if ids[i] is terminating or pending */
DWORD waitResult;
@@ -664,12 +663,13 @@ error_handle:
static void terminate_pending_irp_threads(SERIAL_DEVICE* serial)
{
ULONG_PTR* ids;
int i, nbIds;
nbIds = ListDictionary_GetKeys(serial->IrpThreads, &ids);
WLog_Print(serial->log, WLOG_DEBUG, "Terminating %d IRP thread(s)", nbIds);
WINPR_ASSERT(serial);
for (i = 0; i < nbIds; i++)
ULONG_PTR* ids = NULL;
const size_t nbIds = ListDictionary_GetKeys(serial->IrpThreads, &ids);
WLog_Print(serial->log, WLOG_DEBUG, "Terminating %" PRIuz " IRP thread(s)", nbIds);
for (size_t i = 0; i < nbIds; i++)
{
HANDLE irpThread;
ULONG_PTR id = ids[i];