Forum Discussion
VIRTUALCHANNELINIT returns CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY error
Our application uses Remote Desktop Services virtual channels. The first time user connects to remote machine using Remote Desktop app (msrdcw.exe that starts msrdc.exe process when connection is initiated) everything works as expected. After logging off and then re-connecting to the same target machine VIRTUALCHANNELINIT callback function returns CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY (15) error. Everything works fine if the same is done with Remote Desktop Connection (mstsc.exe).
Call to VIRTUALCHANNELINIT is done from within VirtualChannelEntry function in all cases (otherwise it would not work the first time, I guess).
Apparently the difference between Remote Desktop Connection and Remote Desktop apps is that when disconnecting from session the former terminates both Virtual Channel and mstsc.exe process but the latter only terminates Virtual Channel but leaves msrdc.exe process running. So one found workaround is to stop msrdc.exe process by clicking "Disconnect all sessions" in the notification area menu. After that the next connection from Virtual Desktop initialises Virtual Channel successfully.
Additionally if we modify our dll so that VirtualChannelOpen is not called, then every call to VirtualChannelInit succeeds.
So the question is why does VIRTUALCHANNELINIT callback function succeeds the first time but returns CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY error on any subsequent re-connection when used with Remote Desktop (msrdcw.exe) but succeeds every time when used with Remote Desktop Connection (mstsc.exe)?
- Soo Kuan TeoMicrosoftThanks for reporting. This is a known issue, we are working on the fix.
- Robot1queCopper Contributor
Soo Kuan Teo do you know, by any chance, when approximately this will be resolved?
- Soo Kuan TeoMicrosoftThank you for your patience, the bug is currently in the normal queue to be fixed. If you like, please do open a support case, provide us more details, recommend the support to escalate the case to WVD team, and also put in the case the link to the TEchcommunity conversation.