Share via


VirtualChannelWrite

This function sends data from the client end of a virtual channel to a partner application on the server end.

UINT VCAPITYPE VirtualChannelWrite(
  DWORD openHandle,
  LPVOID pData,
  ULONG dataLength,
  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] 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 Values

The following table shows the return values for this function.

Value Description
CHANNEL_RC_OK Function succeeded.
CHANNEL_RC_BAD_CHANNEL_HANDLE The openHandle parameter is not valid.
CHANNEL_RC_NO_MEMORY Out-of-memory condition.
CHANNEL_RC_NOT_CONNECTED Client has not connected to a terminal server.
CHANNEL_RC_NULL_DATA The pData parameter 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.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Cchannel.h.
Link Library: Developer implemented.

See Also

RDP Functions

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.