Menu

#1647 Problems with multiple rdp session and application mode (fix included)

None
open-accepted
nobody
None
5
2026-03-26
2025-06-25
jkanefendt
No

We're using TightVNC in application mode for multiple parallel rdp session and discovered that each tvnserver Process uses the same name for the control pipe (\Device\NamedPipe\TightVNC_Application_Control_On_Session_...). When using tvnserver -controlapp to start a sever-initiated connection, this results in a randomly chosen tvnserver application mode instance.

We tracked down the problem to the source file tvncontrol-app/ControlPipeName.cpp where the pipe name is formatted using the active console session id:

    pipeName->format(_T("%s_On_Session_%d"),
      ServerApplicationNames::FOR_APP_CONTROL_APP_SERVICE_PIPE_NAME,
      WTS::getActiveConsoleSessionId(log));
  }

The value returned by WTS::getActiveConsoleSessionId is the same for every process as long as a specific console session exists.

To make the pipe name unique and consistent per application mode instance, we suggest to use the id of the process' wts session. Please see our patch at https://github.com/jkanefendt/TightVNC/commit/2782f4a9b6ae38a6ce2374422b0d17c770963f00

Discussion

  • Anton

    Anton - 2025-08-19

    Hi!
    We made a fix for this issue in commercial version and I will add it to open source one.

    DWORD WTS::getProcessSessionId(LogWriter* log)
    {
      DWORD id;
      ProcessIdToSessionId(GetCurrentProcessId(), &id);
      return id;
    }
    

    Several our commercial clients use "connect to RDP" mode but we don't have enough feedback and we don't understand very well what task is being solved with such a connection.

     
  • Anton

    Anton - 2026-03-26
    • status: open --> open-accepted
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB