rdpsnd/server: fix incorrect use of channe handle.
This commit is contained in:
parent
a98e13a86e
commit
a4c583c459
@ -199,13 +199,13 @@ static void* rdpsnd_server_thread(void* arg)
|
|||||||
|
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
BytesReturned = 0;
|
BytesReturned = 0;
|
||||||
ChannelEvent = context->priv->ChannelHandle;
|
ChannelEvent = NULL;
|
||||||
|
|
||||||
s = Stream_New(NULL, 4096);
|
s = Stream_New(NULL, 4096);
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (WTSVirtualChannelQuery(ChannelEvent, WTSVirtualEventHandle, &buffer, &BytesReturned))
|
if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, &buffer, &BytesReturned))
|
||||||
{
|
{
|
||||||
if (BytesReturned == sizeof(HANDLE))
|
if (BytesReturned == sizeof(HANDLE))
|
||||||
CopyMemory(&ChannelEvent, buffer, sizeof(HANDLE));
|
CopyMemory(&ChannelEvent, buffer, sizeof(HANDLE));
|
||||||
@ -214,7 +214,8 @@ static void* rdpsnd_server_thread(void* arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nCount = 0;
|
nCount = 0;
|
||||||
events[nCount++] = ChannelEvent;
|
if (ChannelEvent)
|
||||||
|
events[nCount++] = ChannelEvent;
|
||||||
events[nCount++] = context->priv->StopEvent;
|
events[nCount++] = context->priv->StopEvent;
|
||||||
|
|
||||||
if (!rdpsnd_server_send_formats(context, s))
|
if (!rdpsnd_server_send_formats(context, s))
|
||||||
@ -230,7 +231,7 @@ static void* rdpsnd_server_thread(void* arg)
|
|||||||
|
|
||||||
Stream_SetPosition(s, 0);
|
Stream_SetPosition(s, 0);
|
||||||
|
|
||||||
if (!WTSVirtualChannelRead(ChannelEvent, 0, (PCHAR)Stream_Buffer(s),
|
if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s),
|
||||||
Stream_Capacity(s), &BytesReturned))
|
Stream_Capacity(s), &BytesReturned))
|
||||||
{
|
{
|
||||||
if (!BytesReturned)
|
if (!BytesReturned)
|
||||||
@ -238,7 +239,7 @@ static void* rdpsnd_server_thread(void* arg)
|
|||||||
|
|
||||||
Stream_EnsureRemainingCapacity(s, BytesReturned);
|
Stream_EnsureRemainingCapacity(s, BytesReturned);
|
||||||
|
|
||||||
if (!WTSVirtualChannelRead(ChannelEvent, 0, (PCHAR)Stream_Buffer(s),
|
if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s),
|
||||||
Stream_Capacity(s), &BytesReturned))
|
Stream_Capacity(s), &BytesReturned))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user