VIRTUALCHANNELINIT returns CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY error

%3CLINGO-SUB%20id%3D%22lingo-sub-1496327%22%20slang%3D%22en-US%22%3EVIRTUALCHANNELINIT%20returns%20CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1496327%22%20slang%3D%22en-US%22%3E%3CP%3EOur%26nbsp%3Bapplication%26nbsp%3Buses%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3BServices%26nbsp%3Bvirtual%26nbsp%3Bchannels.%26nbsp%3BThe%26nbsp%3Bfirst%26nbsp%3Btime%26nbsp%3Buser%26nbsp%3Bconnects%26nbsp%3Bto%26nbsp%3Bremote%26nbsp%3Bmachine%26nbsp%3Busing%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3Bapp%26nbsp%3B(msrdcw.exe%26nbsp%3Bthat%26nbsp%3Bstarts%26nbsp%3Bmsrdc.exe%26nbsp%3Bprocess%26nbsp%3Bwhen%26nbsp%3Bconnection%26nbsp%3Bis%26nbsp%3Binitiated)%26nbsp%3Beverything%26nbsp%3Bworks%26nbsp%3Bas%26nbsp%3Bexpected.%26nbsp%3BAfter%26nbsp%3Blogging%26nbsp%3Boff%26nbsp%3Band%26nbsp%3Bthen%26nbsp%3Bre-connecting%26nbsp%3Bto%26nbsp%3Bthe%26nbsp%3Bsame%26nbsp%3Btarget%26nbsp%3Bmachine%26nbsp%3BVIRTUALCHANNELINIT%26nbsp%3Bcallback%26nbsp%3Bfunction%26nbsp%3Breturns%26nbsp%3BCHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%26nbsp%3B(15)%26nbsp%3Berror.%26nbsp%3BEverything%26nbsp%3Bworks%26nbsp%3Bfine%26nbsp%3Bif%26nbsp%3Bthe%26nbsp%3Bsame%26nbsp%3Bis%26nbsp%3Bdone%26nbsp%3Bwith%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3BConnection%26nbsp%3B(mstsc.exe).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECall%26nbsp%3Bto%26nbsp%3BVIRTUALCHANNELINIT%26nbsp%3Bis%26nbsp%3Bdone%26nbsp%3Bfrom%26nbsp%3Bwithin%26nbsp%3BVirtualChannelEntry%26nbsp%3Bfunction%26nbsp%3Bin%26nbsp%3Ball%26nbsp%3Bcases%26nbsp%3B(otherwise%26nbsp%3Bit%26nbsp%3Bwould%26nbsp%3Bnot%26nbsp%3Bwork%26nbsp%3Bthe%26nbsp%3Bfirst%26nbsp%3Btime%2C%26nbsp%3BI%26nbsp%3Bguess).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EApparently%26nbsp%3Bthe%26nbsp%3Bdifference%26nbsp%3Bbetween%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3BConnection%26nbsp%3Band%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3Bapps%26nbsp%3Bis%26nbsp%3Bthat%26nbsp%3Bwhen%26nbsp%3Bdisconnecting%26nbsp%3Bfrom%26nbsp%3Bsession%26nbsp%3Bthe%26nbsp%3Bformer%26nbsp%3Bterminates%26nbsp%3Bboth%26nbsp%3BVirtual%26nbsp%3BChannel%26nbsp%3Band%26nbsp%3Bmstsc.exe%26nbsp%3Bprocess%26nbsp%3Bbut%26nbsp%3Bthe%26nbsp%3Blatter%26nbsp%3Bonly%26nbsp%3Bterminates%26nbsp%3BVirtual%26nbsp%3BChannel%26nbsp%3Bbut%26nbsp%3Bleaves%26nbsp%3Bmsrdc.exe%26nbsp%3Bprocess%26nbsp%3Brunning.%26nbsp%3BSo%26nbsp%3Bone%26nbsp%3Bfound%26nbsp%3Bworkaround%26nbsp%3Bis%26nbsp%3Bto%26nbsp%3Bstop%26nbsp%3Bmsrdc.exe%26nbsp%3Bprocess%26nbsp%3Bby%26nbsp%3Bclicking%26nbsp%3B%22Disconnect%26nbsp%3Ball%26nbsp%3Bsessions%22%26nbsp%3Bin%26nbsp%3Bthe%26nbsp%3Bnotification%26nbsp%3Barea%26nbsp%3Bmenu.%26nbsp%3BAfter%26nbsp%3Bthat%26nbsp%3Bthe%26nbsp%3Bnext%26nbsp%3Bconnection%26nbsp%3Bfrom%26nbsp%3BVirtual%26nbsp%3BDesktop%26nbsp%3Binitialises%26nbsp%3BVirtual%26nbsp%3BChannel%26nbsp%3Bsuccessfully.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditionally%26nbsp%3Bif%26nbsp%3Bwe%26nbsp%3Bmodify%26nbsp%3Bour%26nbsp%3Bdll%26nbsp%3Bso%26nbsp%3Bthat%26nbsp%3BVirtualChannelOpen%26nbsp%3Bis%26nbsp%3Bnot%26nbsp%3Bcalled%2C%26nbsp%3Bthen%26nbsp%3Bevery%26nbsp%3Bcall%26nbsp%3Bto%26nbsp%3BVirtualChannelInit%26nbsp%3Bsucceeds.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%26nbsp%3Bthe%26nbsp%3Bquestion%26nbsp%3Bis%26nbsp%3Bwhy%26nbsp%3Bdoes%26nbsp%3BVIRTUALCHANNELINIT%26nbsp%3Bcallback%26nbsp%3Bfunction%26nbsp%3Bsucceeds%26nbsp%3Bthe%26nbsp%3Bfirst%26nbsp%3Btime%26nbsp%3Bbut%26nbsp%3Breturns%26nbsp%3BCHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%26nbsp%3Berror%26nbsp%3Bon%26nbsp%3Bany%26nbsp%3Bsubsequent%26nbsp%3Bre-connection%26nbsp%3Bwhen%26nbsp%3Bused%26nbsp%3Bwith%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3B(msrdcw.exe)%26nbsp%3Bbut%26nbsp%3Bsucceeds%26nbsp%3Bevery%26nbsp%3Btime%26nbsp%3Bwhen%26nbsp%3Bused%26nbsp%3Bwith%26nbsp%3BRemote%26nbsp%3BDesktop%26nbsp%3BConnection%26nbsp%3B(mstsc.exe)%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1496856%22%20slang%3D%22en-US%22%3ERe%3A%20VIRTUALCHANNELINIT%20returns%20CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1496856%22%20slang%3D%22en-US%22%3EThanks%20for%20reporting.%20This%20is%20a%20known%20issue%2C%20we%20are%20working%20on%20the%20fix.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1523907%22%20slang%3D%22en-US%22%3ERe%3A%20VIRTUALCHANNELINIT%20returns%20CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1523907%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F181812%22%20target%3D%22_blank%22%3E%40Soo%20Kuan%20Teo%3C%2FA%3E%26nbsp%3Bdo%20you%20know%2C%20by%20any%20chance%2C%20when%20approximately%20this%20will%20be%20resolved%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1533862%22%20slang%3D%22en-US%22%3ERe%3A%20VIRTUALCHANNELINIT%20returns%20CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1533862%22%20slang%3D%22en-US%22%3EThank%20you%20for%20your%20patience%2C%20the%20bug%20is%20currently%20in%20the%20normal%20queue%20to%20be%20fixed.%20If%20you%20like%2C%20please%20do%20open%20a%20support%20case%2C%20provide%20us%20more%20details%2C%20recommend%20the%20support%20to%20escalate%20the%20case%20to%20WVD%20team%2C%20and%20also%20put%20in%20the%20case%20the%20link%20to%20the%20TEchcommunity%20conversation.%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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)?

3 Replies
Highlighted
Thanks for reporting. This is a known issue, we are working on the fix.
Highlighted

@Soo Kuan Teo do you know, by any chance, when approximately this will be resolved?

Highlighted
Thank 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.