From bb242b9a896cd85186e882057303c22de846a16d Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 16 Sep 2024 05:06:07 +0200 Subject: [PATCH] [return checks] fix use of WaitForSingleObject --- channels/rdpecam/client/v4l/camera_v4l.c | 3 ++- channels/rdpei/client/rdpei_main.c | 2 +- channels/rdpsnd/client/rdpsnd_main.c | 2 +- channels/rdpsnd/client/winmm/rdpsnd_winmm.c | 2 +- channels/serial/client/serial_main.c | 2 +- channels/urbdrc/client/libusb/libusb_udevman.c | 4 ++-- client/Windows/wf_client.c | 2 +- client/Windows/wf_cliprdr.c | 2 +- client/X11/cli/xfreerdp.c | 2 +- client/X11/xf_client.c | 4 ++-- client/common/client.c | 2 +- client/common/client_cliprdr_file.c | 2 +- libfreerdp/core/gateway/tsg.c | 2 +- libfreerdp/core/message.c | 2 +- libfreerdp/core/test/TestConnect.c | 4 ++-- server/Sample/sfreerdp.c | 2 +- server/Windows/cli/wfreerdp.c | 2 +- server/Windows/wf_peer.c | 2 +- server/Windows/wf_update.c | 2 +- server/proxy/pf_server.c | 2 +- server/shadow/Win/win_rdp.c | 2 +- server/shadow/X11/x11_shadow.c | 2 +- server/shadow/shadow.c | 2 +- server/shadow/shadow_mcevent.c | 4 ++-- server/shadow/shadow_server.c | 2 +- winpr/libwinpr/error/test/TestErrorSetLastError.c | 8 ++++---- winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c | 10 +++++----- winpr/libwinpr/pool/pool.c | 2 +- winpr/libwinpr/sspi/test/TestSchannel.c | 2 +- winpr/libwinpr/synch/barrier.c | 2 +- winpr/libwinpr/synch/test/TestSynchAPC.c | 6 +++--- winpr/libwinpr/utils/ssl.c | 4 ++-- winpr/libwinpr/utils/test/TestMessagePipe.c | 4 ++-- 33 files changed, 49 insertions(+), 48 deletions(-) diff --git a/channels/rdpecam/client/v4l/camera_v4l.c b/channels/rdpecam/client/v4l/camera_v4l.c index 601ba083e..d1a76b287 100644 --- a/channels/rdpecam/client/v4l/camera_v4l.c +++ b/channels/rdpecam/client/v4l/camera_v4l.c @@ -27,6 +27,7 @@ #include #include "camera.h" +#include #define TAG CHANNELS_TAG("rdpecam-v4l.client") @@ -530,7 +531,7 @@ UINT cam_v4l_stream_stop(CamV4lStream* stream) if (stream->captureThread) { - WaitForSingleObject(stream->captureThread, INFINITE); + (void)WaitForSingleObject(stream->captureThread, INFINITE); (void)CloseHandle(stream->captureThread); stream->captureThread = NULL; } diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 4adb700d5..802b737de 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -1446,7 +1446,7 @@ static void terminate_plugin_cb(GENERIC_DYNVC_PLUGIN* base) if (rdpei->thread) { - WaitForSingleObject(rdpei->thread, INFINITE); + (void)WaitForSingleObject(rdpei->thread, INFINITE); (void)CloseHandle(rdpei->thread); } diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 6efefbeea..fe72e03cf 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -1461,7 +1461,7 @@ void rdpsnd_virtual_channel_event_terminated(rdpsndPlugin* rdpsnd) if (rdpsnd->thread) { - WaitForSingleObject(rdpsnd->thread, INFINITE); + (void)WaitForSingleObject(rdpsnd->thread, INFINITE); (void)CloseHandle(rdpsnd->thread); } MessageQueue_Free(rdpsnd->queue); diff --git a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c index 6a39aebbb..fd4c471b2 100644 --- a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c +++ b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c @@ -180,7 +180,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device) if (winmm->hThread) { - WaitForSingleObject(winmm->hThread, INFINITE); + (void)WaitForSingleObject(winmm->hThread, INFINITE); (void)CloseHandle(winmm->hThread); winmm->hThread = NULL; } diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index fe363a46e..6ea2ec28e 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -826,7 +826,7 @@ static void irp_thread_close(void* arg) else { (void)TerminateThread(hdl, 0); - WaitForSingleObject(hdl, INFINITE); + (void)WaitForSingleObject(hdl, INFINITE); (void)CloseHandle(hdl); } } diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index 1c5f45555..fc9edc627 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -436,7 +436,7 @@ static IUDEVICE* udevman_get_udevice_by_ChannelID(IUDEVMAN* idevman, UINT32 chan static void udevman_loading_lock(IUDEVMAN* idevman) { UDEVMAN* udevman = (UDEVMAN*)idevman; - WaitForSingleObject(udevman->devman_loading, INFINITE); + (void)WaitForSingleObject(udevman->devman_loading, INFINITE); } static void udevman_loading_unlock(IUDEVMAN* idevman) @@ -469,7 +469,7 @@ static void udevman_free(IUDEVMAN* idevman) udevman->running = FALSE; if (udevman->thread) { - WaitForSingleObject(udevman->thread, INFINITE); + (void)WaitForSingleObject(udevman->thread, INFINITE); (void)CloseHandle(udevman->thread); } diff --git a/client/Windows/wf_client.c b/client/Windows/wf_client.c index 647090265..fc6d68f7a 100644 --- a/client/Windows/wf_client.c +++ b/client/Windows/wf_client.c @@ -1466,7 +1466,7 @@ static int wfreerdp_client_stop(rdpContext* context) if (wfc->keyboardThread) { PostThreadMessage(wfc->keyboardThreadId, WM_QUIT, 0, 0); - WaitForSingleObject(wfc->keyboardThread, INFINITE); + (void)WaitForSingleObject(wfc->keyboardThread, INFINITE); (void)CloseHandle(wfc->keyboardThread); wfc->keyboardThread = NULL; wfc->keyboardThreadId = 0; diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index 63f4b3fee..bda8ef3b8 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -2535,7 +2535,7 @@ BOOL wf_cliprdr_uninit(wfContext* wfc, CliprdrClientContext* cliprdr) if (clipboard->thread) { - WaitForSingleObject(clipboard->thread, INFINITE); + (void)WaitForSingleObject(clipboard->thread, INFINITE); (void)CloseHandle(clipboard->thread); } diff --git a/client/X11/cli/xfreerdp.c b/client/X11/cli/xfreerdp.c index ae17db532..97e31d5f2 100644 --- a/client/X11/cli/xfreerdp.c +++ b/client/X11/cli/xfreerdp.c @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) thread = freerdp_client_get_thread(context); - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); GetExitCodeThread(thread, &dwExitCode); rc = xf_exit_code_from_disconnect_reason(dwExitCode); diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 3cf227e42..f1c92ade5 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -805,7 +805,7 @@ void xf_lock_x11_(xfContext* xfc, const char* fkt) { if (!xfc->UseXThreads) - WaitForSingleObject(xfc->mutex, INFINITE); + (void)WaitForSingleObject(xfc->mutex, INFINITE); else XLockDisplay(xfc->display); @@ -1451,7 +1451,7 @@ static void xf_post_disconnect(freerdp* instance) if (xfc->pipethread) { - WaitForSingleObject(xfc->pipethread, INFINITE); + (void)WaitForSingleObject(xfc->pipethread, INFINITE); (void)CloseHandle(xfc->pipethread); xfc->pipethread = NULL; } diff --git a/client/common/client.c b/client/common/client.c index 78805a8f8..001ae7571 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1339,7 +1339,7 @@ int freerdp_client_common_stop(rdpContext* context) if (cctx->thread) { - WaitForSingleObject(cctx->thread, INFINITE); + (void)WaitForSingleObject(cctx->thread, INFINITE); (void)CloseHandle(cctx->thread); cctx->thread = NULL; } diff --git a/client/common/client_cliprdr_file.c b/client/common/client_cliprdr_file.c index 7f86187fb..efba81713 100644 --- a/client/common/client_cliprdr_file.c +++ b/client/common/client_cliprdr_file.c @@ -2078,7 +2078,7 @@ void cliprdr_file_context_free(CliprdrFileContext* file) cliprdr_file_session_terminate(file, TRUE); WLog_Print(file->log, WLOG_DEBUG, "Waiting on FUSE thread"); - WaitForSingleObject(file->fuse_thread, INFINITE); + (void)WaitForSingleObject(file->fuse_thread, INFINITE); (void)CloseHandle(file->fuse_thread); } if (file->fuse_stop_sync) diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index abd219bbf..06592d5d0 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -2844,7 +2844,7 @@ static int tsg_read(rdpTsg* tsg, BYTE* data, size_t length) if (!tsg_check_event_handles(tsg)) return -1; - WaitForSingleObject(rpc->client->PipeEvent, 100); + (void)WaitForSingleObject(rpc->client->PipeEvent, 100); } } } while (transport_get_blocking(rpc->transport)); diff --git a/libfreerdp/core/message.c b/libfreerdp/core/message.c index be9936bdd..353e5ec4b 100644 --- a/libfreerdp/core/message.c +++ b/libfreerdp/core/message.c @@ -2905,7 +2905,7 @@ void update_message_proxy_free(rdpUpdateProxy* message) { rdp_update_internal* up = update_cast(message->update); if (MessageQueue_PostQuit(up->queue, 0)) - WaitForSingleObject(message->thread, INFINITE); + (void)WaitForSingleObject(message->thread, INFINITE); (void)CloseHandle(message->thread); free(message); diff --git a/libfreerdp/core/test/TestConnect.c b/libfreerdp/core/test/TestConnect.c index 350031ffb..31f6019ef 100644 --- a/libfreerdp/core/test/TestConnect.c +++ b/libfreerdp/core/test/TestConnect.c @@ -148,7 +148,7 @@ static int testAbort(int port) return -1; } - WaitForSingleObject(s_sync, INFINITE); + (void)WaitForSingleObject(s_sync, INFINITE); Sleep(100); /* Wait until freerdp_connect has been called */ if (instance) { @@ -293,7 +293,7 @@ static int testSuccess(int port) if (!TerminateProcess(process.hProcess, 0)) goto fail; - WaitForSingleObject(process.hProcess, INFINITE); + (void)WaitForSingleObject(process.hProcess, INFINITE); (void)CloseHandle(process.hProcess); (void)CloseHandle(process.hThread); printf("%s: returned %d!\n", __func__, r); diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 608e9cfd9..d466c1241 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -83,7 +83,7 @@ static void test_peer_context_free(freerdp_peer* client, rdpContext* ctx) { WINPR_ASSERT(context->stopEvent); (void)SetEvent(context->stopEvent); - WaitForSingleObject(context->debug_channel_thread, INFINITE); + (void)WaitForSingleObject(context->debug_channel_thread, INFINITE); (void)CloseHandle(context->debug_channel_thread); } diff --git a/server/Windows/cli/wfreerdp.c b/server/Windows/cli/wfreerdp.c index efc1bf51b..110bce3a5 100644 --- a/server/Windows/cli/wfreerdp.c +++ b/server/Windows/cli/wfreerdp.c @@ -163,7 +163,7 @@ int main(int argc, char* argv[]) WLog_INFO(TAG, "Starting server"); wfreerdp_server_start(server); - WaitForSingleObject(server->thread, INFINITE); + (void)WaitForSingleObject(server->thread, INFINITE); WLog_INFO(TAG, "Stopping server"); wfreerdp_server_stop(server); wfreerdp_server_free(server); diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index cfadf6926..1fb60ffb7 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -218,7 +218,7 @@ static DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam) } (void)SetEvent(context->socketEvent); - WaitForSingleObject(context->socketSemaphore, INFINITE); + (void)WaitForSingleObject(context->socketSemaphore, INFINITE); if (context->socketClose) break; diff --git a/server/Windows/wf_update.c b/server/Windows/wf_update.c index 1a6b02d5b..8867efb84 100644 --- a/server/Windows/wf_update.c +++ b/server/Windows/wf_update.c @@ -80,7 +80,7 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam) { // WLog_DBG(TAG, "Waiting for %d of %d", index + 1, wfi->activePeerCount); // WaitForSingleObject(wfi->updateSemaphore, INFINITE); - WaitForSingleObject(wfi->updateSemaphore, 1000); + (void)WaitForSingleObject(wfi->updateSemaphore, 1000); } // WLog_DBG(TAG, "End of parallel sending"); diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index 0415438e7..6955e5229 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -719,7 +719,7 @@ out_free_peer: if (pdata && pdata->client_thread) { proxy_data_abort_connect(pdata); - WaitForSingleObject(pdata->client_thread, INFINITE); + (void)WaitForSingleObject(pdata->client_thread, INFINITE); } { diff --git a/server/shadow/Win/win_rdp.c b/server/shadow/Win/win_rdp.c index 077a6787f..3332f1e64 100644 --- a/server/shadow/Win/win_rdp.c +++ b/server/shadow/Win/win_rdp.c @@ -80,7 +80,7 @@ static BOOL shw_end_paint(rdpContext* context) } (void)SetEvent(subsystem->RdpUpdateEnterEvent); - WaitForSingleObject(subsystem->RdpUpdateLeaveEvent, INFINITE); + (void)WaitForSingleObject(subsystem->RdpUpdateLeaveEvent, INFINITE); (void)ResetEvent(subsystem->RdpUpdateLeaveEvent); return TRUE; } diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c index f11d9e038..298c6db4e 100644 --- a/server/shadow/X11/x11_shadow.c +++ b/server/shadow/X11/x11_shadow.c @@ -1460,7 +1460,7 @@ static int x11_shadow_subsystem_stop(rdpShadowSubsystem* sub) if (subsystem->thread) { if (MessageQueue_PostQuit(subsystem->common.MsgPipe->In, 0)) - WaitForSingleObject(subsystem->thread, INFINITE); + (void)WaitForSingleObject(subsystem->thread, INFINITE); (void)CloseHandle(subsystem->thread); subsystem->thread = NULL; diff --git a/server/shadow/shadow.c b/server/shadow/shadow.c index 614305cc7..59c3b074f 100644 --- a/server/shadow/shadow.c +++ b/server/shadow/shadow.c @@ -172,7 +172,7 @@ int main(int argc, char** argv) } #endif - WaitForSingleObject(server->thread, INFINITE); + (void)WaitForSingleObject(server->thread, INFINITE); if (!GetExitCodeThread(server->thread, &dwExitCode)) status = -1; diff --git a/server/shadow/shadow_mcevent.c b/server/shadow/shadow_mcevent.c index 602062380..905f5aa74 100644 --- a/server/shadow/shadow_mcevent.c +++ b/server/shadow/shadow_mcevent.c @@ -140,7 +140,7 @@ static void WaitForSubscribers(rdpShadowMultiClientEvent* event) /* Wait for clients done */ WLog_VRB(TAG, "Server wait event %d. %d clients.\n", event->eventid, event->consuming); LeaveCriticalSection(&(event->lock)); - WaitForSingleObject(event->doneEvent, INFINITE); + (void)WaitForSingleObject(event->doneEvent, INFINITE); EnterCriticalSection(&(event->lock)); WLog_VRB(TAG, "Server quit event %d. %d clients.\n", event->eventid, event->consuming); } @@ -219,7 +219,7 @@ static BOOL Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL w */ event->waiting++; LeaveCriticalSection(&(event->lock)); - WaitForSingleObject(event->barrierEvent, INFINITE); + (void)WaitForSingleObject(event->barrierEvent, INFINITE); EnterCriticalSection(&(event->lock)); event->waiting--; if (event->waiting == 0) diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index 40d41bb63..bc72637fd 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -743,7 +743,7 @@ int shadow_server_stop(rdpShadowServer* server) if (server->thread) { (void)SetEvent(server->StopEvent); - WaitForSingleObject(server->thread, INFINITE); + (void)WaitForSingleObject(server->thread, INFINITE); (void)CloseHandle(server->thread); server->thread = NULL; if (server->listener && server->listener->Close) diff --git a/winpr/libwinpr/error/test/TestErrorSetLastError.c b/winpr/libwinpr/error/test/TestErrorSetLastError.c index 310757cb0..b274addc6 100644 --- a/winpr/libwinpr/error/test/TestErrorSetLastError.c +++ b/winpr/libwinpr/error/test/TestErrorSetLastError.c @@ -113,10 +113,10 @@ int TestErrorSetLastError(int argc, char* argv[]) Sleep(200); bStopTest = TRUE; - WaitForSingleObject(threads[0], INFINITE); - WaitForSingleObject(threads[1], INFINITE); - WaitForSingleObject(threads[2], INFINITE); - WaitForSingleObject(threads[3], INFINITE); + (void)WaitForSingleObject(threads[0], INFINITE); + (void)WaitForSingleObject(threads[1], INFINITE); + (void)WaitForSingleObject(threads[2], INFINITE); + (void)WaitForSingleObject(threads[3], INFINITE); (void)CloseHandle(threads[0]); (void)CloseHandle(threads[1]); diff --git a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c index f7b5da243..314a9c4e2 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c @@ -33,7 +33,7 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) DWORD nNumberOfBytesToWrite = 0; DWORD lpNumberOfBytesRead = 0; DWORD lpNumberOfBytesWritten = 0; - WaitForSingleObject(ReadyEvent, INFINITE); + (void)WaitForSingleObject(ReadyEvent, INFINITE); hNamedPipe = CreateFile(lpszPipeNameMt, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -198,7 +198,7 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) int numPipes = 0; BOOL bSuccess = FALSE; numPipes = TESTNUMPIPESST; - WaitForSingleObject(ReadyEvent, INFINITE); + (void)WaitForSingleObject(ReadyEvent, INFINITE); for (int i = 0; i < numPipes; i++) { @@ -500,9 +500,9 @@ int TestPipeCreateNamedPipe(int argc, char* argv[]) printf("CreateThread (ServerThread) failure: (%" PRIu32 ")\n", GetLastError()); return -1; } - WaitForSingleObject(SingleThread, INFINITE); - WaitForSingleObject(ClientThread, INFINITE); - WaitForSingleObject(ServerThread, INFINITE); + (void)WaitForSingleObject(SingleThread, INFINITE); + (void)WaitForSingleObject(ClientThread, INFINITE); + (void)WaitForSingleObject(ServerThread, INFINITE); (void)CloseHandle(SingleThread); (void)CloseHandle(ClientThread); (void)CloseHandle(ServerThread); diff --git a/winpr/libwinpr/pool/pool.c b/winpr/libwinpr/pool/pool.c index 790f16189..39bbaaac9 100644 --- a/winpr/libwinpr/pool/pool.c +++ b/winpr/libwinpr/pool/pool.c @@ -100,7 +100,7 @@ static DWORD WINAPI thread_pool_work_func(LPVOID arg) static void threads_close(void* thread) { - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); (void)CloseHandle(thread); } diff --git a/winpr/libwinpr/sspi/test/TestSchannel.c b/winpr/libwinpr/sspi/test/TestSchannel.c index 3f9751a98..6e504376d 100644 --- a/winpr/libwinpr/sspi/test/TestSchannel.c +++ b/winpr/libwinpr/sspi/test/TestSchannel.c @@ -848,7 +848,7 @@ int TestSchannel(int argc, char* argv[]) schannel_send(table, g_ServerWritePipe, &context, test_LastDummyMessage, sizeof(test_LastDummyMessage)); - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); sspi_GlobalFinish(); return 0; } diff --git a/winpr/libwinpr/synch/barrier.c b/winpr/libwinpr/synch/barrier.c index 610adbb71..8d2680bc2 100644 --- a/winpr/libwinpr/synch/barrier.c +++ b/winpr/libwinpr/synch/barrier.c @@ -208,7 +208,7 @@ BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrie } if (block) - WaitForSingleObject(hCurrentEvent, INFINITE); + (void)WaitForSingleObject(hCurrentEvent, INFINITE); return FALSE; } diff --git a/winpr/libwinpr/synch/test/TestSynchAPC.c b/winpr/libwinpr/synch/test/TestSynchAPC.c index edff1c0cf..2cd7f897a 100644 --- a/winpr/libwinpr/synch/test/TestSynchAPC.c +++ b/winpr/libwinpr/synch/test/TestSynchAPC.c @@ -127,7 +127,7 @@ int TestSynchAPC(int argc, char* argv[]) thread = CreateThread(NULL, 0, uncleanThread, &userApcArg, 0, NULL); if (!thread) return 10; - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); (void)CloseHandle(thread); if (userApcArg.called || userApcArg.error) @@ -141,7 +141,7 @@ int TestSynchAPC(int argc, char* argv[]) if (!QueueUserAPC((PAPCFUNC)userApc, thread, (ULONG_PTR)&userApcArg)) return 21; - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); (void)CloseHandle(thread); if (!userApcArg.called) @@ -162,7 +162,7 @@ int TestSynchAPC(int argc, char* argv[]) if (!thread) return 33; - WaitForSingleObject(thread, INFINITE); + (void)WaitForSingleObject(thread, INFINITE); (void)CloseHandle(thread); if (uncleanCloseData.timer1Calls != 1 || uncleanCloseData.timer2Calls != 0) diff --git a/winpr/libwinpr/utils/ssl.c b/winpr/libwinpr/utils/ssl.c index c4427808d..fe498934f 100644 --- a/winpr/libwinpr/utils/ssl.c +++ b/winpr/libwinpr/utils/ssl.c @@ -75,7 +75,7 @@ static void _winpr_openssl_locking(int mode, int type, const char* file, int lin { if (mode & CRYPTO_LOCK) { - WaitForSingleObject(g_winpr_openssl_locks[type], INFINITE); + (void)WaitForSingleObject(g_winpr_openssl_locks[type], INFINITE); } else { @@ -104,7 +104,7 @@ static void _winpr_openssl_dynlock_lock(int mode, struct CRYPTO_dynlock_value* d { if (mode & CRYPTO_LOCK) { - WaitForSingleObject(dynlock->mutex, INFINITE); + (void)WaitForSingleObject(dynlock->mutex, INFINITE); } else { diff --git a/winpr/libwinpr/utils/test/TestMessagePipe.c b/winpr/libwinpr/utils/test/TestMessagePipe.c index c8b903978..bfa4ab6d5 100644 --- a/winpr/libwinpr/utils/test/TestMessagePipe.c +++ b/winpr/libwinpr/utils/test/TestMessagePipe.c @@ -88,8 +88,8 @@ int TestMessagePipe(int argc, char* argv[]) goto out; } - WaitForSingleObject(ClientThread, INFINITE); - WaitForSingleObject(ServerThread, INFINITE); + (void)WaitForSingleObject(ClientThread, INFINITE); + (void)WaitForSingleObject(ServerThread, INFINITE); ret = 0;