Forum Discussion

Vinz Focker's avatar
Vinz Focker
Copper Contributor
Jul 24, 2018

Bug: no reconnect to disconnected session with fSingleSessionPerUser=0

Affected: All Server 2019 Insider Previews including build 17713

 

Steps to reproduce: (no need to install RDSH role to reproduce the bug)

  • enable multiple sessions per user:
    Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections -> "Restrict Remote Desktop Services users to a single Remote Desktop Services Session" to "Disabled"
  • rdp to the server and log in as Administrator
  • close the mstsc window or disconnect
  • rdp to the server again, log in as Administrator and you will get a new session
    taskmgr now shows 2 Administrator sessions: one disconnected and the new one just created
  • close the mstsc window or disconnect
  • rdp to the server again, log in as Administrator and you will get a new session
    taskmgr now shows 3 Administrator sessions: two disconnected and the new one just created
  • ...

If fSingleSessionPerUser == 0 you will not be able to reconnect to any disconnected session.

 

However, now the interesting part:
If you lock the session before the disconnect (ctrl+alt+end -> lock, then close mstsc) you will be successfully reconnected.

I suspect the error is in  termsrv.dll's CSessionArbitrationHelper::Sessions_EnumDisconnectedUserSessions function.

 

You can alsoe reproduce this without rdp, directly on the console.
Set the policy as mentioned above, log in as Administrator, disconnect your own session in task manager, log in again and you get a new session.

 

This bug seems to be in termsrv.dll since Windows 10 1803 already.

 

Resources