A reconnection to a disconnected seamless WTS session fails to entering seamless mode, a black desktop with remote app is shown and not just the window. This works on Win2003 but not on 2008R2 and seamlessrdpshell.exe is running in the session which is reconnected. To reproduce; rdesktop -A -s "c:\\seamlessrdp\\seamlessrdpshell.exe notepad.exe" then wait for notepad to show up seamlessly, then hit ctrl-c to exit rdesktop and get session in disconnected state. reconnect using the same line above and get the black desktop.
A few drilldowns into this issue shows that when a session is reconnected WTSVirtualChannelWrite() fails to send a reconnect "HELLO" to rdesktop, writing 0 bytes on virtual channel. Writing to a virtual channel were remote end has been disconnected and then reconnected works as expected on win2003. More digging into this issue reveals that WTSVirtualChannelOpen() is obsolete and WTSVirtualChannelOpenEx() should be used instead which minimum requirments are Vista / Windows Server 2008... http://msdn.microsoft.com/en-us/library/windows/desktop/bb540882(v=vs.85).aspx http://blogs.msdn.com/b/rds/archive/2007/09/20/dynamic-virtual-channels.aspxrequiremetns
We are kind of forced to use the current API function for virtual channel due to the new one is not backward compatible with XP / 2003. I tried to close and reopen the virtual channel upon reconnection and it solves the problem, see upstream commit r1691.
Tester need to test seamless reconnection functionality on all supported platforms XP, 2003 and 2008r2
If anyone knows if this bug affected Windows 2008 as well, please fill in.
Tested on Windows 2008r2: OK
This works as expected.