- status: open --> open-accepted
- Group: -->
Hello,
When running in application mode, you are currently using a named pipe of the format "TightVNC_Application_Control_On_Session_%d" where %d is retrieved using WTS::getActiveConsoleSessionId() (see tvncontrol-app/ControlPipeName.cpp).
The problem is that getActiveConsoleSessionId() is giving you the session ID of the console session, not the session the application is running in, which is certainly what you intended.
This means that if you are using tvnserver.exe on a windows terminal server in application mode with multiple users logged in at the same time, then they will all be using the same pipe name.
You can see this bug in action: If you log into a terminal server as two users, and launch tvnserver.exe in each one, then change a setting on the interface of user A, it will edit the registry setting of user B (and A). This is because the control interface is listening on "TightVNC_Application_Control_On_Session_1" for both users, (even if their session numbers are 2 and 3) - since the console is on session 1
What you no-doubt mean to do is to make it so that there is a pipe listening on "TightVNC_Application_Control_On_Session_2" for the application running on session 2 and "TightVNC_Application_Control_On_Session_3" for the application running on session 3. To do this, you will need to use ProcessIdToSessionId() and pass in the processes own PID to it (instead of using getActiveConsoleSessionId()).
Thank you for your time.
Chris