Under what circumstances would CHANNEL_EVENT_CONNECTED and CHANNEL_EVENT_DISCONNECTED not be matched pairs?
A customer has environment of Windows 7/XP running Remote Desktop connecting to Windows Server 2012 R2 / 2012 / 2008R2.
We provide a virtual channel, customer has installed on the client but on (some of) the server side is not installed.
Only when disconnecting from Windows Server 2012 R2 where virtual channel is not present do they get an error from our software.
We and Customer get CHANNEL_EVENT_INITIALIZED and CHANNEL_EVENT_TERMINATED as expected.
In Windows 7 environment the virtual channel client is getting CHANNEL_EVENT_DISCONNECTED when the remote connection is closed, but we have some error due to not being notified CHANNEL_EVENT_CONNECTED when the connection was started.
In our Windows 8 environment it performs as expected -
- without server side installed we get neither event
- with server side installed we get both events.
In comparison, when winlogon is presented there (seemed to be) additional messages when connecting from Windows 7, they flick past quickly but mentioned session manager. I had not noticed similar messages when connecting from Windows 8.
We can work around this to avoid disruption to the customer, but would like to know more about this scenario so we can better handle the use case.
Or perhaps there is a Hotfix for RemoteDesktop?
One thought was session redirection as according to the doc on VirtualChannelInitEvent (http://msdn.microsoft.com/en-us/library/aa383568(v=vs.85).aspx)
CHANNEL_EVENT_CONNECTED and CHANNEL_EVENT_DISCONNECTED event notifications will not be sent if the connection is transferred to another session. However, the server-side plug-in that is administering the session to which the connection is transferred will receive a reconnection notification. A server-side tool such as Tscon.exe can be used to transfer connections. Refer to Monitoring Session Connections and Disconnections for more information on reconnection notifications.
If the user-mode plug-in must be notified that it has been reconnected (for example, if it must reset its state), the server-side plug-in should send a notification message to the client. This notification should use the protocol that the plug-ins use to communicate with each other.
It seems that even if redirection would be an issue, both events would not be present.