VirtualChannelWrite function pointer
Sends data from the client end of a virtual channel to a partner application on the server end.
Remote Desktop Services provides a pointer to a VirtualChannelWrite function in the CHANNEL_ENTRY_POINTS structure passed to your VirtualChannelEntry entry point.
Syntax
typedef UINT ( VCAPITYPE *VirtualChannelWrite)(
_In_ DWORD openHandle,
_In_ LPVOID pData,
_In_ ULONG dataLength,
_In_ LPVOID pUserData
);
Parameters
- openHandle [in]
-
Handle to the virtual channel. This is the handle returned in the pOpenHandle parameter of the VirtualChannelOpen function.
- pData [in]
-
Pointer to a buffer containing the data to write.
- dataLength [in]
-
Specifies the number of bytes of the data in the pData buffer to write.
- pUserData [in]
-
An application-defined value. This value is passed to your VirtualChannelOpenEvent function when the write operation is completed or canceled.
Return value
If the function succeeds, the return value is CHANNEL_RC_OK.
If an error occurs, the function returns one of the following values.
- CHANNEL_RC_BAD_CHANNEL_HANDLE
-
The pOpenHandle parameter is not valid.
- CHANNEL_RC_NO_MEMORY
-
Indicates an out-of-memory condition.
- CHANNEL_RC_NOT_CONNECTED
-
The client has not connected to an RD Session Host server.
- CHANNEL_RC_NULL_DATA
-
The pData parameter is not valid.
- CHANNEL_RC_ZERO_LENGTH
-
The dataLength parameter is zero.
Remarks
The VirtualChannelWrite function is asynchronous. When the write operation has been completed, your VirtualChannelOpenEvent function receives a CHANNEL_EVENT_WRITE_COMPLETE notification. Until that notification is received, the caller must not free or reuse the pData buffer passed to VirtualChannelWrite.
The value specified for the pUserData parameter is passed to your VirtualChannelOpenEvent function when the write operation is completed or canceled. You can use this data to identify the write operation.
The server add-in at the server end of the virtual channel calls the WTSVirtualChannelRead function to read the data written by a VirtualChannelWrite call.
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
See also