channels/server: start refactoring to fully match WTSApi

This commit is contained in:
Marc-André Moreau 2013-08-20 18:06:19 -04:00
parent cea6de16ee
commit 552cee7431
8 changed files with 76 additions and 80 deletions

View File

@ -78,7 +78,7 @@ static void audin_server_send_version(audin_server* audin, wStream* s)
{ {
Stream_Write_UINT8(s, MSG_SNDIN_VERSION); Stream_Write_UINT8(s, MSG_SNDIN_VERSION);
Stream_Write_UINT32(s, 1); /* Version (4 bytes) */ Stream_Write_UINT32(s, 1); /* Version (4 bytes) */
WTSVirtualChannelWrite(audin->audin_channel, Stream_Buffer(s), Stream_GetPosition(s), NULL); WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
} }
static BOOL audin_server_recv_version(audin_server* audin, wStream* s, UINT32 length) static BOOL audin_server_recv_version(audin_server* audin, wStream* s, UINT32 length)
@ -130,7 +130,7 @@ static void audin_server_send_formats(audin_server* audin, wStream* s)
} }
} }
WTSVirtualChannelWrite(audin->audin_channel, Stream_Buffer(s), Stream_GetPosition(s), NULL); WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
} }
static BOOL audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 length) static BOOL audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 length)
@ -166,6 +166,7 @@ static BOOL audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 le
Stream_Read_UINT16(s, audin->context.client_formats[i].nBlockAlign); Stream_Read_UINT16(s, audin->context.client_formats[i].nBlockAlign);
Stream_Read_UINT16(s, audin->context.client_formats[i].wBitsPerSample); Stream_Read_UINT16(s, audin->context.client_formats[i].wBitsPerSample);
Stream_Read_UINT16(s, audin->context.client_formats[i].cbSize); Stream_Read_UINT16(s, audin->context.client_formats[i].cbSize);
if (audin->context.client_formats[i].cbSize > 0) if (audin->context.client_formats[i].cbSize > 0)
{ {
Stream_Seek(s, audin->context.client_formats[i].cbSize); Stream_Seek(s, audin->context.client_formats[i].cbSize);
@ -201,7 +202,7 @@ static void audin_server_send_open(audin_server* audin, wStream* s)
Stream_Write_UINT16(s, 16); /* wBitsPerSample */ Stream_Write_UINT16(s, 16); /* wBitsPerSample */
Stream_Write_UINT16(s, 0); /* cbSize */ Stream_Write_UINT16(s, 0); /* cbSize */
WTSVirtualChannelWrite(audin->audin_channel, Stream_Buffer(s), Stream_GetPosition(s), NULL); WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
} }
static BOOL audin_server_recv_open_reply(audin_server* audin, wStream* s, UINT32 length) static BOOL audin_server_recv_open_reply(audin_server* audin, wStream* s, UINT32 length)
@ -283,10 +284,10 @@ static void* audin_server_thread_func(void* arg)
void* buffer; void* buffer;
BYTE MessageId; BYTE MessageId;
BOOL ready = FALSE; BOOL ready = FALSE;
UINT32 bytes_returned = 0; DWORD BytesReturned = 0;
audin_server* audin = (audin_server*) arg; audin_server* audin = (audin_server*) arg;
if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualFileHandle, &buffer, &bytes_returned) == TRUE) if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualFileHandle, &buffer, &BytesReturned) == TRUE)
{ {
fd = *((void**) buffer); fd = *((void**) buffer);
WTSFreeMemory(buffer); WTSFreeMemory(buffer);
@ -303,7 +304,7 @@ static void* audin_server_thread_func(void* arg)
if (WaitForSingleObject(audin->stopEvent, 0) == WAIT_OBJECT_0) if (WaitForSingleObject(audin->stopEvent, 0) == WAIT_OBJECT_0)
break; break;
if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualChannelReady, &buffer, &bytes_returned) == FALSE) if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualChannelReady, &buffer, &BytesReturned) == FALSE)
break; break;
ready = *((BOOL*) buffer); ready = *((BOOL*) buffer);
@ -330,46 +331,48 @@ static void* audin_server_thread_func(void* arg)
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
if (WTSVirtualChannelRead(audin->audin_channel, 0, Stream_Buffer(s), if (WTSVirtualChannelRead(audin->audin_channel, 0, (PCHAR) Stream_Buffer(s),
Stream_Capacity(s), &bytes_returned) == FALSE) Stream_Capacity(s), &BytesReturned) == FALSE)
{ {
if (bytes_returned == 0) if (BytesReturned == 0)
break; break;
Stream_EnsureRemainingCapacity(s, (int) bytes_returned); Stream_EnsureRemainingCapacity(s, BytesReturned);
if (WTSVirtualChannelRead(audin->audin_channel, 0, Stream_Buffer(s), if (WTSVirtualChannelRead(audin->audin_channel, 0, (PCHAR) Stream_Buffer(s),
Stream_Capacity(s), &bytes_returned) == FALSE) Stream_Capacity(s), &BytesReturned) == FALSE)
{
break; break;
}
} }
if (bytes_returned < 1) if (BytesReturned < 1)
continue; continue;
Stream_Read_UINT8(s, MessageId); Stream_Read_UINT8(s, MessageId);
bytes_returned--; BytesReturned--;
switch (MessageId) switch (MessageId)
{ {
case MSG_SNDIN_VERSION: case MSG_SNDIN_VERSION:
if (audin_server_recv_version(audin, s, bytes_returned)) if (audin_server_recv_version(audin, s, BytesReturned))
audin_server_send_formats(audin, s); audin_server_send_formats(audin, s);
break; break;
case MSG_SNDIN_FORMATS: case MSG_SNDIN_FORMATS:
if (audin_server_recv_formats(audin, s, bytes_returned)) if (audin_server_recv_formats(audin, s, BytesReturned))
audin_server_send_open(audin, s); audin_server_send_open(audin, s);
break; break;
case MSG_SNDIN_OPEN_REPLY: case MSG_SNDIN_OPEN_REPLY:
audin_server_recv_open_reply(audin, s, bytes_returned); audin_server_recv_open_reply(audin, s, BytesReturned);
break; break;
case MSG_SNDIN_DATA_INCOMING: case MSG_SNDIN_DATA_INCOMING:
break; break;
case MSG_SNDIN_DATA: case MSG_SNDIN_DATA:
audin_server_recv_data(audin, s, bytes_returned); audin_server_recv_data(audin, s, BytesReturned);
break; break;
case MSG_SNDIN_FORMATCHANGE: case MSG_SNDIN_FORMATCHANGE:

View File

@ -96,7 +96,7 @@ static int cliprdr_server_send_capabilities(CliprdrServerContext* context)
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -123,7 +123,7 @@ static int cliprdr_server_send_monitor_ready(CliprdrServerContext* context)
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -150,7 +150,7 @@ static int cliprdr_server_send_format_list_response(CliprdrServerContext* contex
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -392,7 +392,7 @@ static void* cliprdr_server_thread(void* arg)
int position; int position;
HANDLE events[8]; HANDLE events[8];
HANDLE ChannelEvent; HANDLE ChannelEvent;
UINT32 BytesReturned; DWORD BytesReturned;
CLIPRDR_HEADER header; CLIPRDR_HEADER header;
CliprdrServerContext* context; CliprdrServerContext* context;
@ -429,7 +429,7 @@ static void* cliprdr_server_thread(void* arg)
} }
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0,
Stream_Buffer(s), Stream_Capacity(s), &BytesReturned)) (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned))
{ {
if (BytesReturned) if (BytesReturned)
Stream_Seek(s, BytesReturned); Stream_Seek(s, BytesReturned);

View File

@ -35,7 +35,7 @@ static void* drdynvc_server_thread(void* arg)
void* buffer; void* buffer;
HANDLE events[8]; HANDLE events[8];
HANDLE ChannelEvent; HANDLE ChannelEvent;
UINT32 BytesReturned; DWORD BytesReturned;
DrdynvcServerContext* context; DrdynvcServerContext* context;
context = (DrdynvcServerContext*) arg; context = (DrdynvcServerContext*) arg;

View File

@ -51,7 +51,7 @@ static int rdpdr_server_send_announce_request(RdpdrServerContext* context)
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -319,7 +319,7 @@ static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -393,7 +393,7 @@ static int rdpdr_server_send_client_id_confirm(RdpdrServerContext* context)
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -470,7 +470,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context)
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_Length(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), NULL);
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
@ -558,7 +558,7 @@ static void* rdpdr_server_thread(void* arg)
HANDLE events[8]; HANDLE events[8];
RDPDR_HEADER header; RDPDR_HEADER header;
HANDLE ChannelEvent; HANDLE ChannelEvent;
UINT32 BytesReturned; DWORD BytesReturned;
RdpdrServerContext* context; RdpdrServerContext* context;
context = (RdpdrServerContext*) arg; context = (RdpdrServerContext*) arg;
@ -594,7 +594,7 @@ static void* rdpdr_server_thread(void* arg)
break; break;
} }
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, Stream_Pointer(s), if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR) Stream_Pointer(s),
Stream_Capacity(s) - Stream_GetPosition(s), &BytesReturned)) Stream_Capacity(s) - Stream_GetPosition(s), &BytesReturned))
{ {
if (BytesReturned) if (BytesReturned)

View File

@ -74,7 +74,7 @@ static BOOL rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s)
Stream_SetPosition(s, 2); Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, pos - 4); Stream_Write_UINT16(s, pos - 4);
Stream_SetPosition(s, pos); Stream_SetPosition(s, pos);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_GetPosition(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
return status; return status;
@ -163,7 +163,7 @@ static void* rdpsnd_server_thread(void* arg)
UINT16 BodySize; UINT16 BodySize;
HANDLE events[8]; HANDLE events[8];
HANDLE ChannelEvent; HANDLE ChannelEvent;
UINT32 BytesReturned; DWORD BytesReturned;
RdpsndServerContext* context; RdpsndServerContext* context;
context = (RdpsndServerContext*) arg; context = (RdpsndServerContext*) arg;
@ -201,7 +201,7 @@ static void* rdpsnd_server_thread(void* arg)
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0,
Stream_Buffer(s), Stream_Capacity(s), &BytesReturned)) (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned))
{ {
if (BytesReturned) if (BytesReturned)
Stream_Seek(s, BytesReturned); Stream_Seek(s, BytesReturned);
@ -214,7 +214,7 @@ static void* rdpsnd_server_thread(void* arg)
Stream_EnsureRemainingCapacity(s, BytesReturned); Stream_EnsureRemainingCapacity(s, BytesReturned);
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0,
Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE) (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE)
{ {
break; break;
} }
@ -384,7 +384,7 @@ static BOOL rdpsnd_server_send_audio_pdu(RdpsndServerContext* context)
Stream_Seek(s, 3); /* bPad */ Stream_Seek(s, 3); /* bPad */
Stream_Write(s, src, 4); Stream_Write(s, src, 4);
WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_GetPosition(s), NULL); WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
/* Wave PDU */ /* Wave PDU */
@ -395,7 +395,7 @@ static BOOL rdpsnd_server_send_audio_pdu(RdpsndServerContext* context)
if (fill_size > 0) if (fill_size > 0)
Stream_Zero(s, fill_size); Stream_Zero(s, fill_size);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_GetPosition(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
context->priv->out_pending_frames = 0; context->priv->out_pending_frames = 0;
@ -449,7 +449,7 @@ static BOOL rdpsnd_server_set_volume(RdpsndServerContext* context, int left, int
Stream_SetPosition(s, 2); Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, pos - 4); Stream_Write_UINT16(s, pos - 4);
Stream_SetPosition(s, pos); Stream_SetPosition(s, pos);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_GetPosition(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
return status; return status;
@ -480,7 +480,7 @@ static BOOL rdpsnd_server_close(RdpsndServerContext* context)
Stream_SetPosition(s, 2); Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, pos - 4); Stream_Write_UINT16(s, pos - 4);
Stream_SetPosition(s, pos); Stream_SetPosition(s, pos);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_Buffer(s), Stream_GetPosition(s), NULL); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
Stream_SetPosition(s, 0); Stream_SetPosition(s, 0);
return status; return status;

View File

@ -662,11 +662,7 @@ void* WTSVirtualChannelOpenEx(
return channel; return channel;
} }
BOOL WTSVirtualChannelQuery( BOOL WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned)
/* __in */ void* hChannelHandle,
/* __in */ WTS_VIRTUAL_CLASS WtsVirtualClass,
/* __out */ void** ppBuffer,
/* __out */ UINT32* pBytesReturned)
{ {
void* pfd; void* pfd;
BOOL bval; BOOL bval;
@ -739,18 +735,12 @@ BOOL WTSVirtualChannelQuery(
return result; return result;
} }
void WTSFreeMemory( VOID WTSFreeMemory(PVOID pMemory)
/* __in */ void* pMemory)
{ {
free(pMemory); free(pMemory);
} }
BOOL WTSVirtualChannelRead( BOOL WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
/* __in */ void* hChannelHandle,
/* __in */ UINT32 TimeOut,
/* __out */ BYTE* Buffer,
/* __in */ UINT32 BufferSize,
/* __out */ UINT32* pBytesRead)
{ {
wts_data_item* item; wts_data_item* item;
rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle;
@ -784,11 +774,7 @@ BOOL WTSVirtualChannelRead(
return TRUE; return TRUE;
} }
BOOL WTSVirtualChannelWrite( BOOL WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
/* __in */ void* hChannelHandle,
/* __in */ BYTE* Buffer,
/* __in */ UINT32 Length,
/* __out */ UINT32* pBytesWritten)
{ {
rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle;
wts_data_item* item; wts_data_item* item;

View File

@ -35,18 +35,27 @@
#include <freerdp/types.h> #include <freerdp/types.h>
#include <freerdp/peer.h> #include <freerdp/peer.h>
typedef struct WTSVirtualChannelManager WTSVirtualChannelManager; #include <winpr/winpr.h>
#include <winpr/wtypes.h>
#define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001 //#include <winpr/wtsapi.h>
typedef enum _WTS_VIRTUAL_CLASS typedef enum _WTS_VIRTUAL_CLASS
{ {
WTSVirtualClientData, WTSVirtualClientData,
WTSVirtualFileHandle, WTSVirtualFileHandle,
WTSVirtualEventHandle, WTSVirtualEventHandle, /* Extended */
WTSVirtualChannelReady WTSVirtualChannelReady /* Extended */
} WTS_VIRTUAL_CLASS; } WTS_VIRTUAL_CLASS;
#define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001
#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW 0x00000000
#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED 0x00000002
#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH 0x00000004
#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL 0x00000006
#define WTS_CHANNEL_OPTION_DYNAMIC_NO_COMPRESS 0x00000008
typedef struct WTSVirtualChannelManager WTSVirtualChannelManager;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -72,6 +81,9 @@ FREERDP_API HANDLE WTSVirtualChannelManagerGetEventHandle(WTSVirtualChannelManag
* Static virtual channels must be opened from the main thread. Dynamic virtual channels * Static virtual channels must be opened from the main thread. Dynamic virtual channels
* can be opened from any thread. * can be opened from any thread.
*/ */
// WINPR_API HANDLE WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags);
FREERDP_API void* WTSVirtualChannelOpenEx( FREERDP_API void* WTSVirtualChannelOpenEx(
/* __in */ WTSVirtualChannelManager* vcm, /* __in */ WTSVirtualChannelManager* vcm,
/* __in */ const char* pVirtualName, /* __in */ const char* pVirtualName,
@ -83,17 +95,14 @@ FREERDP_API void* WTSVirtualChannelOpenEx(
* Servers use this function to gain access to a virtual channel file handle * Servers use this function to gain access to a virtual channel file handle
* that can be used for asynchronous I/O. * that can be used for asynchronous I/O.
*/ */
FREERDP_API BOOL WTSVirtualChannelQuery(
/* __in */ void* hChannelHandle, WINPR_API BOOL WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned);
/* __in */ WTS_VIRTUAL_CLASS WtsVirtualClass,
/* __out */ void** ppBuffer,
/* __out */ UINT32* pBytesReturned);
/** /**
* Frees memory allocated by WTSVirtualChannelQuery * Frees memory allocated by WTSVirtualChannelQuery
*/ */
FREERDP_API void WTSFreeMemory(
/* __in */ void* pMemory); WINPR_API VOID WTSFreeMemory(PVOID pMemory);
/** /**
* Reads data from the server end of a virtual channel. * Reads data from the server end of a virtual channel.
@ -112,25 +121,21 @@ FREERDP_API void WTSFreeMemory(
* The caller should use the file handle returned by WTSVirtualChannelQuery to * The caller should use the file handle returned by WTSVirtualChannelQuery to
* determine whether a packet has arrived. * determine whether a packet has arrived.
*/ */
FREERDP_API BOOL WTSVirtualChannelRead(
/* __in */ void* hChannelHandle, WINPR_API BOOL WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead);
/* __in */ UINT32 TimeOut,
/* __out */ BYTE* Buffer,
/* __in */ UINT32 BufferSize,
/* __out */ UINT32* pBytesRead);
/** /**
* Writes data to the server end of a virtual channel. * Writes data to the server end of a virtual channel.
*/ */
FREERDP_API BOOL WTSVirtualChannelWrite(
/* __in */ void* hChannelHandle, WINPR_API BOOL WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten);
/* __in */ BYTE* Buffer,
/* __in */ UINT32 Length,
/* __out */ UINT32* pBytesWritten);
/** /**
* Closes an open virtual channel handle. * Closes an open virtual channel handle.
*/ */
// WINPR_API BOOL WTSVirtualChannelClose(HANDLE hChannelHandle);
FREERDP_API BOOL WTSVirtualChannelClose( FREERDP_API BOOL WTSVirtualChannelClose(
/* __in */ void* hChannelHandle); /* __in */ void* hChannelHandle);

View File

@ -717,7 +717,9 @@ typedef struct _WTSUSERCONFIGW
typedef enum _WTS_VIRTUAL_CLASS typedef enum _WTS_VIRTUAL_CLASS
{ {
WTSVirtualClientData, WTSVirtualClientData,
WTSVirtualFileHandle WTSVirtualFileHandle,
WTSVirtualEventHandle, /* Extended */
WTSVirtualChannelReady /* Extended */
} WTS_VIRTUAL_CLASS; } WTS_VIRTUAL_CLASS;
typedef struct _WTS_SESSION_ADDRESS typedef struct _WTS_SESSION_ADDRESS