VirtualChannelOpen (Windows CE 5.0)
This function opens the client end of a virtual channel.
UINT VCAPITYPE VirtualChannelOpen(LPVOID pInitHandle,LPDWORD pOpenHandle,PCHAR pChannelName,PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc);
Parameters
- pInitHandle
[in] Handle to the client connection. This is the handle returned in the ppInitHandle parameter of the VirtualChannelInit function. - pOpenHandle
[out] Pointer to a variable that receives a handle identifying the open virtual channel in subsequent calls to the VirtualChannelWrite and VirtualChannelClose functions. - pChannelName
[in] Pointer to a null-terminated string containing the name of the virtual channel to open. The name must have been registered when the client called VirtualChannelInit. - pChannelOpenEventProc
[in] Pointer to an application-defined VirtualChannelOpenEvent function that Terminal Services calls to notify the client DLL of events for this virtual channel. The following table shows possible values for this parameter.Value Description CHANNEL_EVENT_CONNECTED A connection has been established with a Terminal Server that supports virtual channels. pData points to a null-terminated string with the name of the server. CHANNEL_EVENT_DISCONNECTED The connection to the Terminal Server has been disconnected. The pData parameter is NULL. CHANNEL_EVENT_INITIALIZED The Remote Desktop client initialization has been completed. The pData parameter is NULL. CHANNEL_EVENT_TERMINATED The client has been terminated. The pData parameter is NULL. CHANNEL_EVENT_V1_CONNECTED A connection has been established with a Terminal Server that does not support virtual channels. The pData parameter is NULL. CHANNEL_RC_UNKNOWN_CHANNEL_NAME The channel is unregistered.
Return Values
The following table shows the return values for this function.
Value | Description |
---|---|
CHANNEL_RC_OK | Function succeeded. |
CHANNEL_RC_BAD_INIT_HANDLE | The pInitHandle parameter is not valid. |
Remarks
Terminal Services provides a pointer to a VirtualChannelOpen function in the CHANNEL_ENTRY_POINTS structure passed to your VirtualChannelEntry entry point.
The client DLL cannot call this function until the client has established a connection with a Terminal Server. Your VirtualChannelInitEvent function receives a CHANNEL_EVENT_CONNECTED notification when a Terminal Server connection is established.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Cchannel.h.
Link Library: Developer implemented.
See Also
Send Feedback on this topic to the authors