mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[server,sample] delay WTSVirtualChannelManagerCheckFileDescriptor
Only call WTSVirtualChannelManagerCheckFileDescriptor if there was a event pending on WTSVirtualChannelManagerGetEventHandle This ensures that the drdynvc channel is not opened before it is initialized.
This commit is contained in:
@@ -1159,7 +1159,9 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg)
|
||||
|
||||
count += tmp;
|
||||
}
|
||||
handles[count++] = WTSVirtualChannelManagerGetEventHandle(context->vcm);
|
||||
|
||||
HANDLE channelHandle = WTSVirtualChannelManagerGetEventHandle(context->vcm);
|
||||
handles[count++] = channelHandle;
|
||||
status = WaitForMultipleObjects(count, handles, FALSE, INFINITE);
|
||||
|
||||
if (status == WAIT_FAILED)
|
||||
@@ -1172,6 +1174,9 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg)
|
||||
if (client->CheckFileDescriptor(client) != TRUE)
|
||||
break;
|
||||
|
||||
if (WaitForSingleObject(channelHandle, 0) != WAIT_OBJECT_0)
|
||||
continue;
|
||||
|
||||
if (WTSVirtualChannelManagerCheckFileDescriptor(context->vcm) != TRUE)
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user