[return checks] fix use of ResetEvent

This commit is contained in:
akallabeth 2024-09-16 04:53:18 +02:00
parent 7c8c14294f
commit 94020c183c
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
25 changed files with 33 additions and 33 deletions

View File

@ -651,7 +651,7 @@ static DWORD WINAPI printer_thread_func(LPVOID arg)
else if (rc != WAIT_OBJECT_0)
continue;
ResetEvent(printer_dev->event);
(void)ResetEvent(printer_dev->event);
irp = (IRP*)InterlockedPopEntrySList(printer_dev->pIrpList);
if (irp == NULL)

View File

@ -175,7 +175,7 @@ static DWORD WINAPI copyThread(void* data)
handles[1] = freerdp_abort_event(plugin->channelEntryPoints.context);
status = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
if (status == WAIT_OBJECT_0)
ResetEvent(plugin->writeComplete);
(void)ResetEvent(plugin->writeComplete);
}
fail:

View File

@ -464,7 +464,7 @@ static DWORD WINAPI rdpei_periodic_update(LPVOID arg)
}
if (status == WAIT_OBJECT_0)
ResetEvent(rdpei->event);
(void)ResetEvent(rdpei->event);
LeaveCriticalSection(&rdpei->lock);
}

View File

@ -1316,7 +1316,7 @@ TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, UINT32 stre
static void tsmf_stream_resync(void* arg)
{
TSMF_STREAM* stream = arg;
ResetEvent(stream->ready);
(void)ResetEvent(stream->ready);
}
BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s)

View File

@ -108,7 +108,7 @@ static UINT android_cliprdr_send_client_format_data_request(CliprdrClientContext
formatDataRequest.common.msgFlags = 0;
formatDataRequest.requestedFormatId = formatId;
afc->requestedFormatId = formatId;
ResetEvent(afc->clipboardRequestEvent);
(void)ResetEvent(afc->clipboardRequestEvent);
rc = cliprdr->ClientFormatDataRequest(cliprdr, &formatDataRequest);
fail:
return rc;

View File

@ -99,7 +99,7 @@ static int mac_cliprdr_send_client_format_data_request(CliprdrClientContext *cli
formatDataRequest.requestedFormatId = formatId;
mfc->requestedFormatId = formatId;
ResetEvent(mfc->clipboardRequestEvent);
(void)ResetEvent(mfc->clipboardRequestEvent);
cliprdr->ClientFormatDataRequest(cliprdr, &formatDataRequest);

View File

@ -270,7 +270,7 @@ void WinPREvent::set()
void WinPREvent::clear()
{
ResetEvent(_handle);
(void)ResetEvent(_handle);
}
bool WinPREvent::isSet() const

View File

@ -681,7 +681,7 @@ const void* sdlClip::ClipDataCb(void* userdata, const char* mime_type, size_t* s
std::lock_guard<CriticalSection> lock(clip->_lock);
auto request = clip->_request_queue.front();
clip->_request_queue.pop();
ResetEvent(clip->_event);
(void)ResetEvent(clip->_event);
auto formatID = ClipboardRegisterFormat(clip->_system, mime_type);
auto data = ClipboardGetData(clip->_system, formatID, &len);

View File

@ -316,7 +316,7 @@ void WinPREvent::set()
void WinPREvent::clear()
{
ResetEvent(_handle);
(void)ResetEvent(_handle);
}
bool WinPREvent::isSet() const

View File

@ -106,7 +106,7 @@ static UINT ios_cliprdr_send_client_format_data_request(CliprdrClientContext *cl
formatDataRequest.common.msgFlags = 0;
formatDataRequest.requestedFormatId = formatId;
afc->requestedFormatId = formatId;
ResetEvent(afc->clipboardRequestEvent);
(void)ResetEvent(afc->clipboardRequestEvent);
rc = cliprdr->ClientFormatDataRequest(cliprdr, &formatDataRequest);
fail:
return rc;

View File

@ -1292,7 +1292,7 @@ void clearChannelError(rdpContext* context)
WINPR_ASSERT(context);
context->channelErrorNum = 0;
memset(context->errorDescription, 0, 500);
ResetEvent(context->channelErrorEvent);
(void)ResetEvent(context->channelErrorEvent);
}
WINPR_ATTR_FORMAT_ARG(3, 4)

View File

@ -165,7 +165,7 @@ int rpc_client_receive_pipe_read(RpcClient* client, BYTE* buffer, size_t length)
ringbuffer_commit_read_bytes(&(client->ReceivePipe), status);
if (ringbuffer_used(&(client->ReceivePipe)) < 1)
ResetEvent(client->PipeEvent);
(void)ResetEvent(client->PipeEvent);
LeaveCriticalSection(&(client->PipeLock));

View File

@ -476,7 +476,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance)
{
struct sockaddr_storage peer_addr = { 0 };
WSAResetEvent(listener->events[i]);
(void)WSAResetEvent(listener->events[i]);
int peer_addr_size = sizeof(peer_addr);
int peer_sockfd =
_accept(listener->sockfds[i], (struct sockaddr*)&peer_addr, &peer_addr_size);

View File

@ -149,7 +149,7 @@ static int transport_bio_simple_read(BIO* bio, char* buf, int size)
return 0;
BIO_clear_flags(bio, BIO_FLAGS_READ);
WSAResetEvent(ptr->hEvent);
(void)WSAResetEvent(ptr->hEvent);
status = _recv(ptr->socket, buf, size, 0);
if (status > 0)
@ -1356,7 +1356,7 @@ static int freerdp_tcp_layer_read(void* userContext, void* data, int bytes)
int error = 0;
int status = 0;
WSAResetEvent(tcpLayer->hEvent);
(void)WSAResetEvent(tcpLayer->hEvent);
status = _recv(tcpLayer->sockfd, data, bytes, 0);
if (status > 0)

View File

@ -1427,7 +1427,7 @@ int transport_check_fds(rdpTransport* transport)
if (transport->haveMoreBytesToRead)
{
transport->haveMoreBytesToRead = FALSE;
ResetEvent(transport->rereadEvent);
(void)ResetEvent(transport->rereadEvent);
}
return status;
}

View File

@ -357,7 +357,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
if (client->activated)
wf_update_peer_send(wfi, context);
ResetEvent(context->updateEvent);
(void)ResetEvent(context->updateEvent);
ReleaseSemaphore(wfi->updateSemaphore, 1, NULL);
}
@ -369,7 +369,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
context->socketClose = TRUE;
}
ResetEvent(context->socketEvent);
(void)ResetEvent(context->socketEvent);
ReleaseSemaphore(context->socketSemaphore, 1, NULL);
if (context->socketClose)
@ -392,7 +392,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
if (WaitForSingleObject(context->updateEvent, 0) == 0)
{
ResetEvent(context->updateEvent);
(void)ResetEvent(context->updateEvent);
ReleaseSemaphore(wfi->updateSemaphore, 1, NULL);
}

View File

@ -81,7 +81,7 @@ static BOOL shw_end_paint(rdpContext* context)
(void)SetEvent(subsystem->RdpUpdateEnterEvent);
WaitForSingleObject(subsystem->RdpUpdateLeaveEvent, INFINITE);
ResetEvent(subsystem->RdpUpdateLeaveEvent);
(void)ResetEvent(subsystem->RdpUpdateLeaveEvent);
return TRUE;
}

View File

@ -353,7 +353,7 @@ static DWORD WINAPI win_shadow_subsystem_thread(LPVOID arg)
if (WaitForSingleObject(subsystem->RdpUpdateEnterEvent, 0) == WAIT_OBJECT_0)
{
win_shadow_surface_copy(subsystem);
ResetEvent(subsystem->RdpUpdateEnterEvent);
(void)ResetEvent(subsystem->RdpUpdateEnterEvent);
(void)SetEvent(subsystem->RdpUpdateLeaveEvent);
}
}

View File

@ -128,7 +128,7 @@ static void Publish(rdpShadowMultiClientEvent* event)
{
event->eventid = (event->eventid & 0xff) + 1;
WLog_VRB(TAG, "Server published event %d. %d clients.\n", event->eventid, event->consuming);
ResetEvent(event->doneEvent);
(void)ResetEvent(event->doneEvent);
(void)SetEvent(event->event);
}
}
@ -195,7 +195,7 @@ static BOOL Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL w
if (event->consuming == 0)
{
/* Last client reset event before notify clients to continue */
ResetEvent(event->event);
(void)ResetEvent(event->event);
if (event->waiting > 0)
{
@ -229,7 +229,7 @@ static BOOL Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL w
* We can now discard barrierEvent and notify
* server to continue.
*/
ResetEvent(event->barrierEvent);
(void)ResetEvent(event->barrierEvent);
(void)SetEvent(event->doneEvent);
}
}

View File

@ -249,7 +249,7 @@ VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost)
{
(void)SetEvent(ptpp->TerminateEvent);
ArrayList_Clear(ptpp->Threads);
ResetEvent(ptpp->TerminateEvent);
(void)ResetEvent(ptpp->TerminateEvent);
}
ArrayList_Unlock(ptpp->Threads);
winpr_SetThreadpoolThreadMinimum(ptpp, ptpp->Minimum);

View File

@ -214,7 +214,7 @@ BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrie
}
/* reset the dormant event first */
ResetEvent(hDormantEvent);
(void)ResetEvent(hDormantEvent);
/* reset the remaining counter */
lpBarrier->Reserved1 = lpBarrier->Reserved2;

View File

@ -109,7 +109,7 @@ void CountdownEvent_AddCount(wCountdownEvent* countdown, size_t signalCount)
countdown->count += signalCount;
if (signalSet)
ResetEvent(countdown->event);
(void)ResetEvent(countdown->event);
LeaveCriticalSection(&countdown->lock);
}

View File

@ -192,7 +192,7 @@ int MessageQueue_Get(wMessageQueue* queue, wMessage* message)
queue->size--;
if (queue->size < 1)
ResetEvent(queue->event);
(void)ResetEvent(queue->event);
status = (message->id != WMQ_QUIT) ? 1 : 0;
}
@ -221,7 +221,7 @@ int MessageQueue_Peek(wMessageQueue* queue, wMessage* message, BOOL remove)
queue->size--;
if (queue->size < 1)
ResetEvent(queue->event);
(void)ResetEvent(queue->event);
}
}
@ -304,7 +304,7 @@ int MessageQueue_Clear(wMessageQueue* queue)
queue->head = (queue->head + 1) % queue->capacity;
queue->size--;
}
ResetEvent(queue->event);
(void)ResetEvent(queue->event);
queue->closed = FALSE;
LeaveCriticalSection(&queue->lock);

View File

@ -131,7 +131,7 @@ void Queue_Clear(wQueue* queue)
queue->size = 0;
queue->head = queue->tail = 0;
ResetEvent(queue->event);
(void)ResetEvent(queue->event);
Queue_Unlock(queue);
}
@ -247,7 +247,7 @@ void* Queue_Dequeue(wQueue* queue)
}
if (queue->size < 1)
ResetEvent(queue->event);
(void)ResetEvent(queue->event);
Queue_Unlock(queue);

View File

@ -126,7 +126,7 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel)
ZeroMemory(&(pChannel->overlapped), sizeof(OVERLAPPED));
pChannel->overlapped.hEvent = pChannel->hEvent;
ResetEvent(pChannel->hEvent);
(void)ResetEvent(pChannel->hEvent);
if (pChannel->showProtocol)
{