Fix #5852: handle CHANNEL_EVENT_WRITE_CANCELLED

When channels are cleaned up OpenHandle is most of the time
already 0. Ignore the argument checks for
CHANNEL_EVENT_WRITE_CANCELLED and CHANNEL_EVENT_WRITE_COMPLETE
only check where actually required (CHANNEL_EVENT_DATA_RECEIVED)
This commit is contained in:
Armin Novak
2020-01-29 08:52:25 +01:00
parent 8c8e5e4239
commit d2aef75004
7 changed files with 42 additions and 49 deletions

View File

@@ -1046,15 +1046,14 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam,
UINT error = CHANNEL_RC_OK;
encomspPlugin* encomsp = (encomspPlugin*)lpUserParam;
if (!encomsp || (encomsp->OpenHandle != openHandle))
{
WLog_ERR(TAG, "error no match");
return;
}
switch (event)
{
case CHANNEL_EVENT_DATA_RECEIVED:
if (!encomsp || (encomsp->OpenHandle != openHandle))
{
WLog_ERR(TAG, "error no match");
return;
}
if ((error = encomsp_virtual_channel_event_data_received(encomsp, pData, dataLength,
totalLength, dataFlags)))
WLog_ERR(TAG,
@@ -1076,7 +1075,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam,
break;
}
if (error && encomsp->rdpcontext)
if (error && encomsp && encomsp->rdpcontext)
setChannelError(encomsp->rdpcontext, error,
"encomsp_virtual_channel_open_event reported an error");