[return checks] fix use of SetEvent

This commit is contained in:
akallabeth 2024-09-16 04:50:45 +02:00
parent 80e0c68dca
commit 7d67b8e204
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
60 changed files with 85 additions and 84 deletions

View File

@ -351,7 +351,7 @@ static UINT ainput_server_close(ainput_server_context* context)
if (!ainput->externalThread && ainput->thread) if (!ainput->externalThread && ainput->thread)
{ {
SetEvent(ainput->stopEvent); (void)SetEvent(ainput->stopEvent);
if (WaitForSingleObject(ainput->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(ainput->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -322,7 +322,7 @@ static UINT audin_alsa_close(IAudinDevice* device)
if (alsa->stopEvent) if (alsa->stopEvent)
{ {
SetEvent(alsa->stopEvent); (void)SetEvent(alsa->stopEvent);
if (WaitForSingleObject(alsa->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(alsa->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -332,7 +332,7 @@ static UINT audin_oss_close(IAudinDevice* device)
if (oss->stopEvent != NULL) if (oss->stopEvent != NULL)
{ {
SetEvent(oss->stopEvent); (void)SetEvent(oss->stopEvent);
if (WaitForSingleObject(oss->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(oss->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -227,7 +227,7 @@ static UINT audin_sndio_close(IAudinDevice* device)
if (sndio->stopEvent != NULL) if (sndio->stopEvent != NULL)
{ {
SetEvent(sndio->stopEvent); (void)SetEvent(sndio->stopEvent);
if (WaitForSingleObject(sndio->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(sndio->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -293,7 +293,7 @@ static UINT audin_winmm_close(IAudinDevice* device)
if (!winmm) if (!winmm)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
SetEvent(winmm->stopEvent); (void)SetEvent(winmm->stopEvent);
status = WaitForSingleObject(winmm->thread, INFINITE); status = WaitForSingleObject(winmm->thread, INFINITE);
if (status == WAIT_FAILED) if (status == WAIT_FAILED)

View File

@ -516,7 +516,7 @@ static BOOL audin_server_close(audin_server_context* context)
if (audin->thread) if (audin->thread)
{ {
SetEvent(audin->stopEvent); (void)SetEvent(audin->stopEvent);
if (WaitForSingleObject(audin->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(audin->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -1420,7 +1420,7 @@ static UINT cliprdr_server_stop(CliprdrServerContext* context)
if (cliprdr->StopEvent) if (cliprdr->StopEvent)
{ {
SetEvent(cliprdr->StopEvent); (void)SetEvent(cliprdr->StopEvent);
if (WaitForSingleObject(cliprdr->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(cliprdr->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -550,7 +550,7 @@ static UINT disp_server_close(DispServerContext* context)
if (priv->thread) if (priv->thread)
{ {
SetEvent(priv->stopEvent); (void)SetEvent(priv->stopEvent);
if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -154,7 +154,7 @@ static UINT drdynvc_server_start(DrdynvcServerContext* context)
static UINT drdynvc_server_stop(DrdynvcServerContext* context) static UINT drdynvc_server_stop(DrdynvcServerContext* context)
{ {
UINT error = 0; UINT error = 0;
SetEvent(context->priv->StopEvent); (void)SetEvent(context->priv->StopEvent);
if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -328,7 +328,7 @@ static UINT echo_server_close(echo_server_context* context)
if (echo->thread) if (echo->thread)
{ {
SetEvent(echo->stopEvent); (void)SetEvent(echo->stopEvent);
if (WaitForSingleObject(echo->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(echo->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -327,7 +327,7 @@ static UINT encomsp_server_start(EncomspServerContext* context)
static UINT encomsp_server_stop(EncomspServerContext* context) static UINT encomsp_server_stop(EncomspServerContext* context)
{ {
UINT error = CHANNEL_RC_OK; UINT error = CHANNEL_RC_OK;
SetEvent(context->priv->StopEvent); (void)SetEvent(context->priv->StopEvent);
if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -705,7 +705,7 @@ static UINT gfxredir_server_close(GfxRedirServerContext* context)
if (priv->thread) if (priv->thread)
{ {
SetEvent(priv->stopEvent); (void)SetEvent(priv->stopEvent);
if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -475,7 +475,7 @@ static UINT location_server_close(LocationServerContext* context)
if (!location->externalThread && location->thread) if (!location->externalThread && location->thread)
{ {
SetEvent(location->stopEvent); (void)SetEvent(location->stopEvent);
if (WaitForSingleObject(location->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(location->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -690,7 +690,7 @@ static UINT printer_irp_request(DEVICE* device, IRP* irp)
if (printer_dev->async) if (printer_dev->async)
{ {
InterlockedPushEntrySList(printer_dev->pIrpList, &(irp->ItemEntry)); InterlockedPushEntrySList(printer_dev->pIrpList, &(irp->ItemEntry));
SetEvent(printer_dev->event); (void)SetEvent(printer_dev->event);
} }
else else
{ {
@ -908,7 +908,7 @@ static UINT printer_free(DEVICE* device)
if (printer_dev->async) if (printer_dev->async)
{ {
SetEvent(printer_dev->stopEvent); (void)SetEvent(printer_dev->stopEvent);
if (WaitForSingleObject(printer_dev->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(printer_dev->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -1473,7 +1473,7 @@ static BOOL rail_server_stop(RailServerContext* context)
if (priv->thread) if (priv->thread)
{ {
SetEvent(priv->stopEvent); (void)SetEvent(priv->stopEvent);
if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -246,7 +246,7 @@ static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHa
free(pData); free(pData);
break; break;
case CHANNEL_EVENT_WRITE_COMPLETE: case CHANNEL_EVENT_WRITE_COMPLETE:
SetEvent(plugin->writeComplete); (void)SetEvent(plugin->writeComplete);
free(pData); free(pData);
break; break;
} }

View File

@ -1109,7 +1109,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr)
{ {
#if !defined(_WIN32) #if !defined(_WIN32)
if (rdpdr->stopEvent) if (rdpdr->stopEvent)
SetEvent(rdpdr->stopEvent); (void)SetEvent(rdpdr->stopEvent);
#endif #endif
#ifdef __MACOSX__ #ifdef __MACOSX__
CFRunLoopStop(rdpdr->runLoop); CFRunLoopStop(rdpdr->runLoop);

View File

@ -2168,7 +2168,7 @@ static UINT rdpdr_server_stop(RdpdrServerContext* context)
if (context->priv->StopEvent) if (context->priv->StopEvent)
{ {
SetEvent(context->priv->StopEvent); (void)SetEvent(context->priv->StopEvent);
if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -468,7 +468,7 @@ static UINT enumerator_server_close(CamDevEnumServerContext* context)
if (!enumerator->externalThread && enumerator->thread) if (!enumerator->externalThread && enumerator->thread)
{ {
SetEvent(enumerator->stopEvent); (void)SetEvent(enumerator->stopEvent);
if (WaitForSingleObject(enumerator->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(enumerator->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -620,7 +620,7 @@ static UINT device_server_close(CameraDeviceServerContext* context)
if (!device->externalThread && device->thread) if (!device->externalThread && device->thread)
{ {
SetEvent(device->stopEvent); (void)SetEvent(device->stopEvent);
if (WaitForSingleObject(device->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(device->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -963,7 +963,7 @@ static UINT rdpei_add_contact(RdpeiClientContext* context, const RDPINPUT_CONTAC
contactPoint = &rdpei->contactPoints[contact->contactId]; contactPoint = &rdpei->contactPoints[contact->contactId];
contactPoint->data = *contact; contactPoint->data = *contact;
contactPoint->dirty = TRUE; contactPoint->dirty = TRUE;
SetEvent(rdpei->event); (void)SetEvent(rdpei->event);
LeaveCriticalSection(&rdpei->lock); LeaveCriticalSection(&rdpei->lock);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
@ -1175,7 +1175,7 @@ static UINT rdpei_add_pen(RdpeiClientContext* context, INT32 externalId,
{ {
contactPoint->data = *contact; contactPoint->data = *contact;
contactPoint->dirty = TRUE; contactPoint->dirty = TRUE;
SetEvent(rdpei->event); (void)SetEvent(rdpei->event);
} }
LeaveCriticalSection(&rdpei->lock); LeaveCriticalSection(&rdpei->lock);
@ -1442,7 +1442,7 @@ static void terminate_plugin_cb(GENERIC_DYNVC_PLUGIN* base)
rdpei->running = FALSE; rdpei->running = FALSE;
if (rdpei->event) if (rdpei->event)
SetEvent(rdpei->event); (void)SetEvent(rdpei->event);
if (rdpei->thread) if (rdpei->thread)
{ {

View File

@ -425,7 +425,7 @@ static UINT mouse_cursor_server_close(MouseCursorServerContext* context)
if (!mouse_cursor->externalThread && mouse_cursor->thread) if (!mouse_cursor->externalThread && mouse_cursor->thread)
{ {
SetEvent(mouse_cursor->stopEvent); (void)SetEvent(mouse_cursor->stopEvent);
if (WaitForSingleObject(mouse_cursor->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(mouse_cursor->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -1630,7 +1630,7 @@ BOOL rdpgfx_server_close(RdpgfxServerContext* context)
if (priv->ownThread && priv->thread) if (priv->ownThread && priv->thread)
{ {
SetEvent(priv->stopEvent); (void)SetEvent(priv->stopEvent);
if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -989,7 +989,7 @@ static UINT rdpsnd_server_stop(RdpsndServerContext* context)
{ {
if (context->priv->StopEvent) if (context->priv->StopEvent)
{ {
SetEvent(context->priv->StopEvent); (void)SetEvent(context->priv->StopEvent);
if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -685,7 +685,7 @@ static UINT remdesk_server_start(RemdeskServerContext* context)
static UINT remdesk_server_stop(RemdeskServerContext* context) static UINT remdesk_server_stop(RemdeskServerContext* context)
{ {
UINT error = 0; UINT error = 0;
SetEvent(context->priv->StopEvent); (void)SetEvent(context->priv->StopEvent);
if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -344,7 +344,7 @@ static UINT telemetry_server_close(TelemetryServerContext* context)
if (!telemetry->externalThread && telemetry->thread) if (!telemetry->externalThread && telemetry->thread)
{ {
SetEvent(telemetry->stopEvent); (void)SetEvent(telemetry->stopEvent);
if (WaitForSingleObject(telemetry->thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(telemetry->thread, INFINITE) == WAIT_FAILED)
{ {

View File

@ -1261,13 +1261,13 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id,
stream->rdpcontext = rdpcontext; stream->rdpcontext = rdpcontext;
return stream; return stream;
error_add: error_add:
SetEvent(stream->stopEvent); (void)SetEvent(stream->stopEvent);
if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED)
WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError());
error_ack_thread: error_ack_thread:
SetEvent(stream->stopEvent); (void)SetEvent(stream->stopEvent);
if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED)
WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError());
@ -1402,7 +1402,7 @@ void s_tsmf_stream_free(void* obj)
return; return;
tsmf_stream_stop(stream); tsmf_stream_stop(stream);
SetEvent(stream->stopEvent); (void)SetEvent(stream->stopEvent);
if (stream->play_thread) if (stream->play_thread)
{ {
@ -1454,7 +1454,7 @@ BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pC
UINT32 extensions, UINT32 data_size, BYTE* data) UINT32 extensions, UINT32 data_size, BYTE* data)
{ {
TSMF_SAMPLE* sample = NULL; TSMF_SAMPLE* sample = NULL;
SetEvent(stream->ready); (void)SetEvent(stream->ready);
if (TERMINATING) if (TERMINATING)
return TRUE; return TRUE;

View File

@ -397,7 +397,7 @@ android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr,
if (!format) if (!format)
{ {
SetEvent(afc->clipboardRequestEvent); (void)SetEvent(afc->clipboardRequestEvent);
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
} }
@ -411,7 +411,7 @@ android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr,
if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size)) if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size))
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
SetEvent(afc->clipboardRequestEvent); (void)SetEvent(afc->clipboardRequestEvent);
if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT)) if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT))
{ {

View File

@ -330,7 +330,7 @@ mac_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr,
if (formatDataResponse->common.msgFlags & CB_RESPONSE_FAIL) if (formatDataResponse->common.msgFlags & CB_RESPONSE_FAIL)
{ {
SetEvent(mfc->clipboardRequestEvent); (void)SetEvent(mfc->clipboardRequestEvent);
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
} }
@ -342,7 +342,7 @@ mac_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr,
if (!format) if (!format)
{ {
SetEvent(mfc->clipboardRequestEvent); (void)SetEvent(mfc->clipboardRequestEvent);
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
} }
@ -355,7 +355,7 @@ mac_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr,
ClipboardSetData(mfc->clipboard, formatId, formatDataResponse->requestedFormatData, size); ClipboardSetData(mfc->clipboard, formatId, formatDataResponse->requestedFormatData, size);
SetEvent(mfc->clipboardRequestEvent); (void)SetEvent(mfc->clipboardRequestEvent);
if ((formatId == CF_TEXT) || (formatId == CF_OEMTEXT) || (formatId == CF_UNICODETEXT)) if ((formatId == CF_TEXT) || (formatId == CF_OEMTEXT) || (formatId == CF_UNICODETEXT))
{ {

View File

@ -265,7 +265,7 @@ WinPREvent::~WinPREvent()
void WinPREvent::set() void WinPREvent::set()
{ {
SetEvent(_handle); (void)SetEvent(_handle);
} }
void WinPREvent::clear() void WinPREvent::clear()

View File

@ -638,7 +638,7 @@ UINT sdlClip::ReceiveFormatDataResponse(CliprdrClientContext* context,
if (!sres) if (!sres)
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
SetEvent(clipboard->_event); (void)SetEvent(clipboard->_event);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }

View File

@ -311,7 +311,7 @@ WinPREvent::~WinPREvent()
void WinPREvent::set() void WinPREvent::set()
{ {
SetEvent(_handle); (void)SetEvent(_handle);
} }
void WinPREvent::clear() void WinPREvent::clear()

View File

@ -1144,7 +1144,7 @@ static DWORD WINAPI cliprdr_file_fuse_thread(LPVOID arg)
fuse_opt_add_arg(&args, file->path); fuse_opt_add_arg(&args, file->path);
file->fuse_sess = fuse_session_new(&args, &cliprdr_file_fuse_oper, file->fuse_sess = fuse_session_new(&args, &cliprdr_file_fuse_oper,
sizeof(cliprdr_file_fuse_oper), (void*)file); sizeof(cliprdr_file_fuse_oper), (void*)file);
SetEvent(file->fuse_start_sync); (void)SetEvent(file->fuse_start_sync);
if (file->fuse_sess != NULL) if (file->fuse_sess != NULL)
{ {
@ -2046,7 +2046,7 @@ void cliprdr_file_session_terminate(CliprdrFileContext* file, BOOL stop_thread)
if (stop_thread) if (stop_thread)
{ {
WLog_Print(file->log, WLOG_DEBUG, "Setting FUSE stop event"); WLog_Print(file->log, WLOG_DEBUG, "Setting FUSE stop event");
SetEvent(file->fuse_stop_sync); (void)SetEvent(file->fuse_stop_sync);
} }
#endif #endif
/* not elegant but works for umounting FUSE /* not elegant but works for umounting FUSE
@ -2055,7 +2055,7 @@ void cliprdr_file_session_terminate(CliprdrFileContext* file, BOOL stop_thread)
#if defined(WITH_FUSE) #if defined(WITH_FUSE)
WLog_Print(file->log, WLOG_DEBUG, "Forcing FUSE to check exit flag"); WLog_Print(file->log, WLOG_DEBUG, "Forcing FUSE to check exit flag");
#endif #endif
winpr_PathFileExists(file->path); (void)winpr_PathFileExists(file->path);
} }
void cliprdr_file_context_free(CliprdrFileContext* file) void cliprdr_file_context_free(CliprdrFileContext* file)

View File

@ -391,7 +391,7 @@ ios_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr,
if (!format) if (!format)
{ {
SetEvent(afc->clipboardRequestEvent); (void)SetEvent(afc->clipboardRequestEvent);
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
} }
@ -406,7 +406,7 @@ ios_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr,
if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size)) if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size))
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
SetEvent(afc->clipboardRequestEvent); (void)SetEvent(afc->clipboardRequestEvent);
if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT)) if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT))
{ {

View File

@ -1306,7 +1306,7 @@ void setChannelError(rdpContext* context, UINT errorNum, WINPR_FORMAT_ARG const
context->channelErrorNum = errorNum; context->channelErrorNum = errorNum;
(void)vsnprintf(context->errorDescription, 499, format, ap); (void)vsnprintf(context->errorDescription, 499, format, ap);
va_end(ap); va_end(ap);
SetEvent(context->channelErrorEvent); (void)SetEvent(context->channelErrorEvent);
} }
const char* freerdp_nego_get_routing_token(rdpContext* context, DWORD* length) const char* freerdp_nego_get_routing_token(rdpContext* context, DWORD* length)

View File

@ -137,7 +137,7 @@ static int rpc_client_receive_pipe_write(RpcClient* client, const BYTE* buffer,
status += (int)length; status += (int)length;
if (ringbuffer_used(&(client->ReceivePipe)) > 0) if (ringbuffer_used(&(client->ReceivePipe)) > 0)
SetEvent(client->PipeEvent); (void)SetEvent(client->PipeEvent);
LeaveCriticalSection(&(client->PipeLock)); LeaveCriticalSection(&(client->PipeLock));
return status; return status;

View File

@ -1462,7 +1462,7 @@ int transport_check_fds(rdpTransport* transport)
if (!transport->haveMoreBytesToRead) if (!transport->haveMoreBytesToRead)
{ {
transport->haveMoreBytesToRead = TRUE; transport->haveMoreBytesToRead = TRUE;
SetEvent(transport->rereadEvent); (void)SetEvent(transport->rereadEvent);
} }
return recv_status; return recv_status;
} }

View File

@ -82,7 +82,7 @@ static void test_peer_context_free(freerdp_peer* client, rdpContext* ctx)
if (context->debug_channel_thread) if (context->debug_channel_thread)
{ {
WINPR_ASSERT(context->stopEvent); WINPR_ASSERT(context->stopEvent);
SetEvent(context->stopEvent); (void)SetEvent(context->stopEvent);
WaitForSingleObject(context->debug_channel_thread, INFINITE); WaitForSingleObject(context->debug_channel_thread, INFINITE);
CloseHandle(context->debug_channel_thread); CloseHandle(context->debug_channel_thread);
} }

View File

@ -217,7 +217,7 @@ static DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam)
break; break;
} }
SetEvent(context->socketEvent); (void)SetEvent(context->socketEvent);
WaitForSingleObject(context->socketSemaphore, INFINITE); WaitForSingleObject(context->socketSemaphore, INFINITE);
if (context->socketClose) if (context->socketClose)

View File

@ -70,7 +70,8 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam)
{ {
// WLog_DBG(TAG, "Setting event for %d of %d", index + 1, // WLog_DBG(TAG, "Setting event for %d of %d", index + 1,
// wfi->activePeerCount); // wfi->activePeerCount);
SetEvent(((wfPeerContext*)wfi->peers[index]->context)->updateEvent); (void)SetEvent(
((wfPeerContext*)wfi->peers[index]->context)->updateEvent);
} }
} }
} }

View File

@ -409,7 +409,7 @@ void proxy_data_abort_connect(proxyData* pdata)
{ {
WINPR_ASSERT(pdata); WINPR_ASSERT(pdata);
WINPR_ASSERT(pdata->abort_event); WINPR_ASSERT(pdata->abort_event);
SetEvent(pdata->abort_event); (void)SetEvent(pdata->abort_event);
if (pdata->pc) if (pdata->pc)
freerdp_abort_connect_context(&pdata->pc->context); freerdp_abort_connect_context(&pdata->pc->context);
} }

View File

@ -679,7 +679,7 @@ static DWORD WINAPI pf_server_handle_peer(LPVOID arg)
case DRDYNVC_STATE_READY: case DRDYNVC_STATE_READY:
if (WaitForSingleObject(ps->dynvcReady, 0) == WAIT_TIMEOUT) if (WaitForSingleObject(ps->dynvcReady, 0) == WAIT_TIMEOUT)
{ {
SetEvent(ps->dynvcReady); (void)SetEvent(ps->dynvcReady);
} }
break; break;
@ -1029,7 +1029,7 @@ void pf_server_stop(proxyServer* server)
return; return;
/* signal main thread to stop and wait for the thread to exit */ /* signal main thread to stop and wait for the thread to exit */
SetEvent(server->stopEvent); (void)SetEvent(server->stopEvent);
} }
void pf_server_free(proxyServer* server) void pf_server_free(proxyServer* server)

View File

@ -79,7 +79,7 @@ static BOOL shw_end_paint(rdpContext* context)
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect);
} }
SetEvent(subsystem->RdpUpdateEnterEvent); (void)SetEvent(subsystem->RdpUpdateEnterEvent);
WaitForSingleObject(subsystem->RdpUpdateLeaveEvent, INFINITE); WaitForSingleObject(subsystem->RdpUpdateLeaveEvent, INFINITE);
ResetEvent(subsystem->RdpUpdateLeaveEvent); ResetEvent(subsystem->RdpUpdateLeaveEvent);
return TRUE; return TRUE;
@ -261,7 +261,7 @@ static int shw_freerdp_client_start(rdpContext* context)
static int shw_freerdp_client_stop(rdpContext* context) static int shw_freerdp_client_stop(rdpContext* context)
{ {
shwContext* shw = (shwContext*)context; shwContext* shw = (shwContext*)context;
SetEvent(shw->StopEvent); (void)SetEvent(shw->StopEvent);
return 0; return 0;
} }

View File

@ -354,7 +354,7 @@ static DWORD WINAPI win_shadow_subsystem_thread(LPVOID arg)
{ {
win_shadow_surface_copy(subsystem); win_shadow_surface_copy(subsystem);
ResetEvent(subsystem->RdpUpdateEnterEvent); ResetEvent(subsystem->RdpUpdateEnterEvent);
SetEvent(subsystem->RdpUpdateLeaveEvent); (void)SetEvent(subsystem->RdpUpdateLeaveEvent);
} }
} }

View File

@ -73,7 +73,7 @@ rdpShadowMultiClientEvent* shadow_multiclient_new(void)
event->consuming = 0; event->consuming = 0;
event->waiting = 0; event->waiting = 0;
event->eventid = 0; event->eventid = 0;
SetEvent(event->doneEvent); (void)SetEvent(event->doneEvent);
return event; return event;
out_free_subscribers: out_free_subscribers:
@ -129,7 +129,7 @@ static void Publish(rdpShadowMultiClientEvent* event)
event->eventid = (event->eventid & 0xff) + 1; event->eventid = (event->eventid & 0xff) + 1;
WLog_VRB(TAG, "Server published event %d. %d clients.\n", event->eventid, event->consuming); WLog_VRB(TAG, "Server published event %d. %d clients.\n", event->eventid, event->consuming);
ResetEvent(event->doneEvent); ResetEvent(event->doneEvent);
SetEvent(event->event); (void)SetEvent(event->event);
} }
} }
@ -200,12 +200,12 @@ static BOOL Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL w
if (event->waiting > 0) if (event->waiting > 0)
{ {
/* Notify other clients to continue */ /* Notify other clients to continue */
SetEvent(event->barrierEvent); (void)SetEvent(event->barrierEvent);
} }
else else
{ {
/* Only one client. Notify server directly */ /* Only one client. Notify server directly */
SetEvent(event->doneEvent); (void)SetEvent(event->doneEvent);
} }
} }
else /* (event->consuming > 0) */ else /* (event->consuming > 0) */
@ -230,7 +230,7 @@ static BOOL Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL w
* server to continue. * server to continue.
*/ */
ResetEvent(event->barrierEvent); ResetEvent(event->barrierEvent);
SetEvent(event->doneEvent); (void)SetEvent(event->doneEvent);
} }
} }
} }

View File

@ -742,7 +742,7 @@ int shadow_server_stop(rdpShadowServer* server)
if (server->thread) if (server->thread)
{ {
SetEvent(server->StopEvent); (void)SetEvent(server->StopEvent);
WaitForSingleObject(server->thread, INFINITE); WaitForSingleObject(server->thread, INFINITE);
CloseHandle(server->thread); CloseHandle(server->thread);
server->thread = NULL; server->thread = NULL;

View File

@ -331,7 +331,7 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
lpOverlapped->Internal = 0; lpOverlapped->Internal = 0;
lpOverlapped->InternalHigh = (ULONG_PTR)nNumberOfBytesToRead; lpOverlapped->InternalHigh = (ULONG_PTR)nNumberOfBytesToRead;
lpOverlapped->Pointer = (PVOID)lpBuffer; lpOverlapped->Pointer = (PVOID)lpBuffer;
SetEvent(lpOverlapped->hEvent); (void)SetEvent(lpOverlapped->hEvent);
#endif #endif
} }
@ -426,7 +426,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
cnv.cpv = lpBuffer; cnv.cpv = lpBuffer;
lpOverlapped->Pointer = cnv.pv; lpOverlapped->Pointer = cnv.pv;
} }
SetEvent(lpOverlapped->hEvent); (void)SetEvent(lpOverlapped->hEvent);
#endif #endif
} }
@ -781,7 +781,7 @@ BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped)
lpOverlapped->Internal = 2; lpOverlapped->Internal = 2;
lpOverlapped->InternalHigh = (ULONG_PTR)0; lpOverlapped->InternalHigh = (ULONG_PTR)0;
lpOverlapped->Pointer = (PVOID)NULL; lpOverlapped->Pointer = (PVOID)NULL;
SetEvent(lpOverlapped->hEvent); (void)SetEvent(lpOverlapped->hEvent);
} }
return TRUE; return TRUE;

View File

@ -120,7 +120,7 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg)
goto out; goto out;
} }
SetEvent(ReadyEvent); (void)SetEvent(ReadyEvent);
/** /**
* Note: * Note:

View File

@ -172,7 +172,7 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg)
if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL)))
{ {
printf("server: CreateEvent failure: %" PRIu32 "\n", GetLastError()); printf("server: CreateEvent failure: %" PRIu32 "\n", GetLastError());
SetEvent(serverReadyEvent); /* unblock client thread */ (void)SetEvent(serverReadyEvent); /* unblock client thread */
goto finish; goto finish;
} }
overlapped.hEvent = hEvent; overlapped.hEvent = hEvent;
@ -187,11 +187,11 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg)
if (hNamedPipe == INVALID_HANDLE_VALUE) if (hNamedPipe == INVALID_HANDLE_VALUE)
{ {
printf("server: CreateNamedPipe failure: %" PRIu32 "\n", GetLastError()); printf("server: CreateNamedPipe failure: %" PRIu32 "\n", GetLastError());
SetEvent(serverReadyEvent); /* unblock client thread */ (void)SetEvent(serverReadyEvent); /* unblock client thread */
goto finish; goto finish;
} }
SetEvent(serverReadyEvent); (void)SetEvent(serverReadyEvent);
/* 3: connect named pipe */ /* 3: connect named pipe */

View File

@ -185,7 +185,7 @@ VOID winpr_CloseThreadpool(PTP_POOL ptpp)
return; return;
} }
#endif #endif
SetEvent(ptpp->TerminateEvent); (void)SetEvent(ptpp->TerminateEvent);
ArrayList_Free(ptpp->Threads); ArrayList_Free(ptpp->Threads);
Queue_Free(ptpp->PendingQueue); Queue_Free(ptpp->PendingQueue);
@ -247,7 +247,7 @@ VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost)
ArrayList_Lock(ptpp->Threads); ArrayList_Lock(ptpp->Threads);
if (ArrayList_Count(ptpp->Threads) > ptpp->Maximum) if (ArrayList_Count(ptpp->Threads) > ptpp->Maximum)
{ {
SetEvent(ptpp->TerminateEvent); (void)SetEvent(ptpp->TerminateEvent);
ArrayList_Clear(ptpp->Threads); ArrayList_Clear(ptpp->Threads);
ResetEvent(ptpp->TerminateEvent); ResetEvent(ptpp->TerminateEvent);
} }

View File

@ -224,7 +224,7 @@ BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrie
lpBarrier->Reserved3[0] = (ULONG_PTR)hDormantEvent; lpBarrier->Reserved3[0] = (ULONG_PTR)hDormantEvent;
/* signal the blocked threads */ /* signal the blocked threads */
SetEvent(hCurrentEvent); (void)SetEvent(hCurrentEvent);
return TRUE; return TRUE;
} }

View File

@ -120,7 +120,7 @@ int TestSynchInit(int argc, char* argv[])
} }
Sleep(100); Sleep(100);
SetEvent(hStartEvent); (void)SetEvent(hStartEvent);
for (DWORD i = 0; i < dwCreatedThreads; i++) for (DWORD i = 0; i < dwCreatedThreads; i++)
{ {

View File

@ -192,7 +192,7 @@ static BOOL test_mutex_threading(void)
goto fail; goto fail;
} }
SetEvent(hStartEvent); (void)SetEvent(hStartEvent);
if (WaitForSingleObject(hThread, 2000) != WAIT_OBJECT_0) if (WaitForSingleObject(hThread, 2000) != WAIT_OBJECT_0)
{ {

View File

@ -46,7 +46,7 @@ static VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired)
if (apcData->FireCount == apcData->MaxFireCount) if (apcData->FireCount == apcData->MaxFireCount)
{ {
SetEvent(apcData->CompletionEvent); (void)SetEvent(apcData->CompletionEvent);
} }
} }

View File

@ -28,7 +28,7 @@ static VOID CALLBACK TimerAPCProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwT
if (g_Count >= 5) if (g_Count >= 5)
{ {
SetEvent(g_Event); (void)SetEvent(g_Event);
} }
} }

View File

@ -980,7 +980,7 @@ BOOL DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent)
free(timerQueue); free(timerQueue);
if (CompletionEvent && (CompletionEvent != INVALID_HANDLE_VALUE)) if (CompletionEvent && (CompletionEvent != INVALID_HANDLE_VALUE))
SetEvent(CompletionEvent); (void)SetEvent(CompletionEvent);
return TRUE; return TRUE;
} }
@ -1081,7 +1081,7 @@ BOOL DeleteTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEve
free(timer); free(timer);
if (CompletionEvent && (CompletionEvent != INVALID_HANDLE_VALUE)) if (CompletionEvent && (CompletionEvent != INVALID_HANDLE_VALUE))
SetEvent(CompletionEvent); (void)SetEvent(CompletionEvent);
return TRUE; return TRUE;
} }

View File

@ -142,7 +142,7 @@ BOOL CountdownEvent_Signal(wCountdownEvent* countdown, size_t signalCount)
if (newStatus && (!oldStatus)) if (newStatus && (!oldStatus))
{ {
SetEvent(countdown->event); (void)SetEvent(countdown->event);
status = TRUE; status = TRUE;
} }

View File

@ -146,7 +146,7 @@ BOOL MessageQueue_Dispatch(wMessageQueue* queue, const wMessage* message)
queue->size++; queue->size++;
if (queue->size > 0) if (queue->size > 0)
SetEvent(queue->event); (void)SetEvent(queue->event);
if (message->id == WMQ_QUIT) if (message->id == WMQ_QUIT)
queue->closed = TRUE; queue->closed = TRUE;

View File

@ -220,7 +220,7 @@ BOOL Queue_Enqueue(wQueue* queue, const void* obj)
queue->size++; queue->size++;
if (signalSet) if (signalSet)
SetEvent(queue->event); (void)SetEvent(queue->event);
out: out:
Queue_Unlock(queue); Queue_Unlock(queue);

View File

@ -146,7 +146,7 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel)
pChannel->header->length = numBytes; pChannel->header->length = numBytes;
pChannel->readDone = TRUE; pChannel->readDone = TRUE;
SetEvent(pChannel->hEvent); (void)SetEvent(pChannel->hEvent);
return TRUE; return TRUE;
} }