diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 1d7da6edb..af02c4b20 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -872,6 +872,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 276c4adda..ff32a9794 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -1271,6 +1271,7 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index a7045694d..929b18e55 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -1002,6 +1002,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index 95c601c6d..d3762d324 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -705,6 +705,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/channels/rdp2tcp/client/rdp2tcp_main.c b/channels/rdp2tcp/client/rdp2tcp_main.c index ac4ebdc14..37e05f30d 100644 --- a/channels/rdp2tcp/client/rdp2tcp_main.c +++ b/channels/rdp2tcp/client/rdp2tcp_main.c @@ -232,6 +232,9 @@ static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHa dataReceived(plugin, pData, dataLength, totalLength, dataFlags); break; + case CHANNEL_EVENT_WRITE_CANCELLED: + free(lpUserParam); + break; case CHANNEL_EVENT_WRITE_COMPLETE: SetEvent(plugin->writeComplete); free(lpUserParam); diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 4eff7ff99..6968e5628 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1587,6 +1587,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DW break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 41002401e..743dfc823 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -990,6 +990,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D break; + case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { wStream* s = (wStream*)lpUserParam; diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index f140f38d4..133f7c947 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -38,7 +38,7 @@ static volatile LONG g_OpenHandleSeq = 1; /* use global counter to ensure uniqueness across channel manager instances */ static WINPR_TLS rdpChannelHandles g_ChannelHandles = { NULL, NULL }; -static BOOL freerdp_channels_process_message_free(wMessage* message); +static BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type); static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name( rdpChannels* channels, const char* name) @@ -86,7 +86,7 @@ static void channel_queue_message_free(wMessage* msg) return; ev = (CHANNEL_OPEN_EVENT*)msg->wParam; - freerdp_channels_process_message_free(msg); + freerdp_channels_process_message_free(msg, CHANNEL_EVENT_WRITE_CANCELLED); free(ev); } @@ -442,7 +442,7 @@ int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, return 0; } -BOOL freerdp_channels_process_message_free(wMessage* message) +BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type) { if (message->id == WMQ_QUIT) { @@ -462,14 +462,14 @@ BOOL freerdp_channels_process_message_free(wMessage* message) if (pChannelOpenData->pChannelOpenEventProc) { pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle, - CHANNEL_EVENT_WRITE_COMPLETE, item->UserData, + type, item->UserData, item->DataLength, item->DataLength, 0); } else if (pChannelOpenData->pChannelOpenEventProcEx) { pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam, pChannelOpenData->OpenHandle, - CHANNEL_EVENT_WRITE_COMPLETE, item->UserData, + type, item->UserData, item->DataLength, item->DataLength, 0); } } @@ -501,7 +501,7 @@ static BOOL freerdp_channels_process_message(freerdp* instance, wMessage* messag instance->SendChannelData(instance, channel->ChannelId, item->Data, item->DataLength); } - if (!freerdp_channels_process_message_free(message)) + if (!freerdp_channels_process_message_free(message, CHANNEL_EVENT_WRITE_COMPLETE)) return FALSE; IFCALL(message->Free, message);