VirtualChannelOpen function pointer
Opens the client end of a virtual channel.
Remote Desktop Services provides a pointer to a VirtualChannelOpen function in the CHANNEL_ENTRY_POINTS structure passed to your VirtualChannelEntry entry point.
Syntax
typedef UINT ( VCAPITYPE *VirtualChannelOpen)(
_In_ LPVOID pInitHandle,
_Out_ LPDWORD pOpenHandle,
_In_ PCHAR pChannelName,
_In_ 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 that identifies the open virtual channel in subsequent calls to the VirtualChannelWrite and VirtualChannelClose functions.
- pChannelName [in]
-
Pointer to a null-terminated ANSI character string containing the name of the virtual channel to open. The name must have been registered when the client called the VirtualChannelInit function.
- pChannelOpenEventProc [in]
-
Pointer to an application-defined VirtualChannelOpenEvent function that Remote Desktop Services calls to notify the client DLL of events for this virtual channel.
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_ALREADY_OPEN
-
The channel is already open.
- CHANNEL_RC_BAD_CHANNEL_HANDLE
-
The pOpenHandle parameter is not valid.
- CHANNEL_RC_BAD_INIT_HANDLE
-
The pInitHandle parameter is not valid.
- CHANNEL_RC_BAD_PROC
-
The pChannelOpenEventProc parameter is not valid.
- CHANNEL_RC_NOT_CONNECTED
-
The client has not connected to an RD Session Host server.
- CHANNEL_RC_UNKNOWN_CHANNEL_NAME
-
The channel name specified by the pChannelName parameter is not registered by the client DLL or is otherwise not valid.
Remarks
The client DLL cannot call this function until the client has established a connection with an RD Session Host server. Your VirtualChannelInitEvent function receives a CHANNEL_EVENT_CONNECTED notification when an RD Session Host server connection is established.
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
See also
- VirtualChannelClose
- VirtualChannelInit
- VirtualChannelInitEvent
- VirtualChannelOpenEvent
- VirtualChannelWrite