Share via


VirtualChannelInitEvent

This function is an application-defined callback function. Terminal Services calls this function to notify the client DLL of virtual channel events.

The PCHANNEL_INIT_EVENT_FN type defines a pointer to this callback function. VirtualChannelInitEvent is a placeholder for the application-defined or library-defined function name.

VOID VCAPITYPE VirtualChannelInitEvent(
  LPVOID pInitHandle,
  UINT event,
  LPVOID pData,
  UINT dataLength
);

Parameters

  • pInitHandle
    [in] Handle to the client connection. This is the handle returned in the ppInitHandle parameter of the VirtualChannelInit function.
  • event
    [in] Indicates the event that caused the notification. The following table shows the values for this parameter.
    Value Description
    CHANNEL_EVENT_CONNECTED A connection has been established with a terminal server that supports virtual channels. The pData parameter is a pointer 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.
  • pData
    [in] Pointer to additional data for the event. The type of data depends on the event, as described in the event descriptions.
  • dataLength
    [in] Specifies the size, in bytes, of the data in the pData buffer. The following table shows possible values for this parameter.

Return Values

None.

Remarks

The client DLL uses the VirtualChannelInit function to register its VirtualChannelInitEvent function with Terminal Services.

This function is reentrant on a per-handle basis. It may be called while it is executing, but not more than once on the same handle.

This function is called only after VirtualChannelEntry has completed.

CHANNEL_EVENT_CONNECTED and CHANNEL_EVENT_DISCONNECTED event notifications will not be sent if the connection is transferred to another session. A server-side tool such as tscon.exe can be used to do this. However, the server-side plug-in administering the session the connection is transferred to will receive a reconnection notification.

If the user-mode plug-in must be notified that it has been reconnected; for example, it must reset state, the server-side plug-in should send a notification message to the client. This notification should use the same protocol the plug-ins use to communicate with each other.

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.