From dfcd168af6c0bf1a2a386a92207c71594c86437c Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 9 Dec 2022 11:27:17 +0100 Subject: [PATCH] [channels,rdp2tcp] only reset event if signalled --- channels/rdp2tcp/client/rdp2tcp_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/rdp2tcp/client/rdp2tcp_main.c b/channels/rdp2tcp/client/rdp2tcp_main.c index 3fd6a23ad..c9056b2d0 100644 --- a/channels/rdp2tcp/client/rdp2tcp_main.c +++ b/channels/rdp2tcp/client/rdp2tcp_main.c @@ -174,7 +174,8 @@ static DWORD WINAPI copyThread(void* data) handles[0] = plugin->writeComplete; handles[1] = freerdp_abort_event(plugin->channelEntryPoints.context); status = WaitForMultipleObjects(2, handles, FALSE, INFINITE); - ResetEvent(plugin->writeComplete); + if (status == WAIT_OBJECT_0) + ResetEvent(plugin->writeComplete); } fail: