VirtualChannelOpenEx (Windows CE 5.0)
This function opens the client end of a virtual channel. This function is a virtual extension that can be used to protect per-session data in the virtual channel client DLL.
typedef UINT VCAPITYPE VIRTUALCHANNELOPENEX( LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx);
Parameters
- pInitHandle
[in] Pointer to the handle to the client connection. This is the handle returned in the ppInitHandle parameter of the VirtualChannelInitEx function. - pOpenHandle
[out] Pointer to a variable that receives a handle identifying the open virtual channel in subsequent calls to the VirtualChannelWriteEx and VirtualChannelCloseEx 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 VirtualChannelInitEx. - pChannelOpenEventProcEx
[in] Pointer to an application-defined VirtualChannelOpenEventEx 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. pData is NULL. CHANNEL_EVENT_INITIALIZED The Remote Desktop client initialization has been completed. pData is NULL. CHANNEL_EVENT_TERMINATED The client has been terminated. pData is NULL. CHANNEL_EVENT_V1_CONNECTED A connection has been established with a Terminal Server that does not support virtual channels. pData 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 VirtualChannelOpenEx function in the CHANNEL_ENTRY_POINTS_EX structure passed to your VirtualChannelEntryEx entry point.
The client DLL cannot call this function until the client has established a connection with a Terminal Server. Your VirtualChannelInitEventEx function receives a CHANNEL_EVENT_CONNECTED notification when a Terminal Server connection is established.
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Cchannel.h.
Link Library: Developer implemented.
See Also
Send Feedback on this topic to the authors