fix [core]: 'invalid hHandle' errors

peer_recv_tpkt_pdu calls freerdp_shall_disconnect_context which calls
WaitForSingleObject. Server side the abortEvent is NULL and therefore
every call triggered the following message:

```
[ERROR:com.winpr.sync.wait] [wait.c|WaitForSingleObjectEx|174] - invalid hHandle.
```
This commit is contained in:
Bernhard Miklautz 2024-10-27 19:19:58 +01:00 committed by akallabeth
parent 052c525e09
commit a9deecc99b
2 changed files with 4 additions and 3 deletions

View File

@ -565,7 +565,7 @@ BOOL freerdp_shall_disconnect(freerdp* instance)
BOOL freerdp_shall_disconnect_context(rdpContext* context)
{
if (!context)
if (!context || !context->abortEvent)
return FALSE;
if (WaitForSingleObject(context->abortEvent, 0) != WAIT_OBJECT_0)

View File

@ -47,8 +47,9 @@ BOOL utils_str_copy(const char* value, char** dst)
BOOL utils_abort_connect(rdpContext* context)
{
WINPR_ASSERT(context);
return SetEvent(context->abortEvent);
if (context->abortEvent)
return SetEvent(context->abortEvent);
return FALSE;
}
BOOL utils_reset_abort(rdpContext* context)