From 75ed12f1f01cdd3006e3fb1f9dc47feab87fc0ed Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 28 Oct 2019 16:43:47 +0100 Subject: [PATCH] Fixed userdata pointer and CHANNEL_EVENT_WRITE_CANCELLED message. --- channels/cliprdr/client/cliprdr_main.c | 2 +- channels/drdynvc/client/drdynvc_main.c | 2 +- channels/encomsp/client/encomsp_main.c | 2 +- channels/rail/client/rail_main.c | 2 +- channels/rdp2tcp/client/rdp2tcp_main.c | 4 ++-- channels/rdpdr/client/rdpdr_main.c | 2 +- channels/rdpsnd/client/rdpsnd_main.c | 2 +- libfreerdp/core/client.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index af02c4b20..e93f95628 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -875,7 +875,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index ff32a9794..dd08c9877 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -1274,7 +1274,7 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index 929b18e55..a2482fe74 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -1005,7 +1005,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index d3762d324..fb9add9d9 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -708,7 +708,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/channels/rdp2tcp/client/rdp2tcp_main.c b/channels/rdp2tcp/client/rdp2tcp_main.c index 37e05f30d..bc0ad2f59 100644 --- a/channels/rdp2tcp/client/rdp2tcp_main.c +++ b/channels/rdp2tcp/client/rdp2tcp_main.c @@ -233,11 +233,11 @@ static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHa break; case CHANNEL_EVENT_WRITE_CANCELLED: - free(lpUserParam); + free(pData); break; case CHANNEL_EVENT_WRITE_COMPLETE: SetEvent(plugin->writeComplete); - free(lpUserParam); + free(pData); break; } } diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 6968e5628..a809a1965 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1590,7 +1590,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DW case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 743dfc823..5be8263ce 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -993,7 +993,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D case CHANNEL_EVENT_WRITE_CANCELLED: case CHANNEL_EVENT_WRITE_COMPLETE: { - wStream* s = (wStream*)lpUserParam; + wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } break; diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index 133f7c947..4e50552c0 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -86,13 +86,13 @@ static void channel_queue_message_free(wMessage* msg) return; ev = (CHANNEL_OPEN_EVENT*)msg->wParam; - freerdp_channels_process_message_free(msg, CHANNEL_EVENT_WRITE_CANCELLED); free(ev); } static void channel_queue_free(void* obj) { wMessage* msg = (wMessage*)obj; + freerdp_channels_process_message_free(msg, CHANNEL_EVENT_WRITE_CANCELLED); channel_queue_message_free(msg); }