manuell manuell - 9 months ago 121
C++ Question

How to use Virtual Channels with two RemoteApps located on two different Servers?

I made a 64 bits c++ Virtual Channel Client DLL

I updated my registry, using Virtual Channel Client Registration (I chose the


If I start a Remote Dekstop connection, everything goes fine: my DLL is loaded in a process named
, my exported
callback is called, and, skipping details, I am able to send/receive bytes (with a little help from a process of my own, running in the server session, and which opens the Virtual Channel).

I am also able to open a second Remote Desktop connection to another Server. A second
process is started, it loads my DLL, all is OK.

My problems begin when I replace my two remote Desktops by two "RemoteApps" (one RemoteApp on the first Server, the other on the second Server).

When I launch the first RemoteApp, all is fine (a
starts, and load my DLL).

When I launch the second RemoteApp, there is NO new
, so no way for my DLL to be loaded again, but the existing
does NOT call my exported
. I am not able to establish the Virtual Channel with the second Server.

The order does matter, not the RemoteApps. Only the first RemoteApp launched will give a Virtual Channel with its Server.

If I launch only one RemoteApp, and then launch a full Remote Desktop connection to the other Server, all is OK: two
loading my DLL, two Virtual Channel established.


How to use Virtual Channels with two RemoteApps located on two different Servers?

Why is there only one
when I launch two RemoteApps, from two Servers, and why that single
does not call
for the second connection?

My client OS is Windows 2012.
Problem reproduced with Windows 10 Pro as client.

Answer Source

I got an answer on Microsoft Technet. I reproduce it here, maybe helping future reader.

Add the following line to your RemoteApps RDP files:


Then, there will be one instance of mstsc.exe for each RemoteApps launched, and all of them will call your exported VirtualChannelEntry callback.

Beware, this an answer to the question asked, which states "two RemoteApps located on two different Servers".

The above configuration option may have some bad consequences if you are not in this case.

If you are an expert on that matter, feel free to improve this answer.