return status;
}
-
void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount)
{
void* pfd;
{
DWORD status;
DWORD nCount;
- HANDLE events[32];
+ HANDLE handles[8];
freerdp* instance;
rdpContext* context;
rdpTransport* transport;
context = instance->context;
assert(NULL != instance->context);
+
+ nCount = 0;
+ handles[nCount++] = transport->stopEvent;
+ handles[nCount++] = transport->connectedEvent;
+
+ status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
+
+ if (status == WAIT_OBJECT_0)
+ {
+ ExitThread(0);
+ return NULL;
+ }
while (1)
{
nCount = 0;
- events[nCount++] = transport->stopEvent;
- events[nCount] = transport->connectedEvent;
+ handles[nCount++] = transport->stopEvent;
- status = WaitForMultipleObjects(nCount + 1, events, FALSE, INFINITE);
+ status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
if (status == WAIT_OBJECT_0)
break;
- transport_get_read_handles(transport, (HANDLE*) &events, &nCount);
+ transport_get_read_handles(transport, (HANDLE*) &handles, &nCount);
- status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
+ status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
if (status == WAIT_OBJECT_0)
break;
}
ExitThread(0);
-
return NULL;
}