IWRdsProtocolConnection interface (wtsprotocol.h)

Exposes methods called by the Remote Desktop Services service to configure a client connection. Your protocol must implement this interface to handle connection requests from clients. When the protocol listener receives a connection request from a client, it must create an IWRdsProtocolConnection object and pass it to the Remote Desktop Services service by calling the IWRdsProtocolListenerCallback::OnConnected method. In response, the service adds a reference to the IWRdsProtocolConnectionCallback object and returns a pointer to it. When the connection is no longer needed, the protocol must release the pointer.

During a connection sequence, the following methods are called by the Remote Desktop Services service in the order listed.

  1. GetLogonErrorRedirector
  2. AcceptConnection
  3. GetClientData
  4. GetClientMonitorData
  5. GetUserCredentials
  6. GetLicenseConnection
  7. AuthenticateClientToSession
  8. NotifySessionId
  9. GetInputHandles
  10. GetVideoHandle
  11. ConnectNotify
  12. NotifyCommandProcessCreated
  13. IsUserAllowedToLogon
  14. SessionArbitrationEnumeration
  15. LogonNotify
If the Remote Desktop Services service needs to reconnect after calling SessionArbitrationEnumeration, it reconnects by calling the following methods in the order listed:
  1. DisconnectNotify (Called on the new session that was created.)
  2. NotifySessionId (Called on the existing session.)
  3. GetInputHandles
  4. GetVideoHandle
  5. ConnectNotify
  6. LogonNotify
To disconnect, the Remote Desktop Services service calls the following methods in the order listed:
  1. PreDisconnect
  2. DisconnectNotify
  3. Close
The Remote Desktop Services service can call the following methods at any time after a connection has been established:

Inheritance

The IWRdsProtocolConnection interface inherits from the IUnknown interface. IWRdsProtocolConnection also has these types of members:

Methods

The IWRdsProtocolConnection interface has these methods.

 
IWRdsProtocolConnection::AcceptConnection

Directs the protocol to continue with the connection request.
IWRdsProtocolConnection::AuthenticateClientToSession

Specifies a session that the connection should be reconnected to.
IWRdsProtocolConnection::Close

Closes a connection after the session is disconnected.
IWRdsProtocolConnection::ConnectNotify

Signals the protocol that the session has been initialized.
IWRdsProtocolConnection::CreateVirtualChannel

Requests that the protocol create a virtual channel.
IWRdsProtocolConnection::DisconnectNotify

Notifies the protocol that the session has been disconnected.
IWRdsProtocolConnection::GetClientData

Requests client settings from the protocol.
IWRdsProtocolConnection::GetClientMonitorData

Retrieves the number of monitors and the primary monitor number on the client.
IWRdsProtocolConnection::GetInputHandles

Obtains the handles to input/output devices for the protocol.
IWRdsProtocolConnection::GetLastInputTime

Retrieves the last time the protocol received user input.
IWRdsProtocolConnection::GetLicenseConnection

Retrieves an IWRdsProtocolLicenseConnection object that is used to begin the client licensing process.
IWRdsProtocolConnection::GetLogonErrorRedirector

Retrieves an IWRdsProtocolLogonErrorRedirector interface that specifies how the protocol should handle client logon errors.
IWRdsProtocolConnection::GetProtocolStatus

Retrieves information about the protocol status.
IWRdsProtocolConnection::GetShadowConnection

Retrieves a reference to the shadow connection object from the protocol.
IWRdsProtocolConnection::GetUserCredentials

Returns user credentials.
IWRdsProtocolConnection::GetVideoHandle

Obtains the handle of the video device for the protocol.
IWRdsProtocolConnection::IsUserAllowedToLogon

Determines from the protocol whether a user is allowed to log on to a session.
IWRdsProtocolConnection::LogonNotify

Called when the user has logged on to the session.
IWRdsProtocolConnection::NotifyCommandProcessCreated

Notifies the protocol that the Winlogon.exe process has been created and initialized.
IWRdsProtocolConnection::NotifySessionId

Sends the identifier of the new session to the protocol.
IWRdsProtocolConnection::PreDisconnect

Notifies the protocol that the session is about to be disconnected.
IWRdsProtocolConnection::QueryProperty

Retrieves a property value from the protocol.
IWRdsProtocolConnection::SessionArbitrationEnumeration

Called after arbitration to allow the protocol to specify the sessions to be reconnected.
IWRdsProtocolConnection::SetErrorInfo

Sets error information in the protocol.

Remarks

To avoid a possible deadlock when calling any of the methods on this interface, you should not make any function or method calls that will directly or indirectly result in a Remote Desktop Services API being called. If you need to make any outbound call, you should start a new thread and make the outbound call from the new thread.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2012
Target Platform Windows
Header wtsprotocol.h