【问题标题】:How VNC Disconnects the already connected RDP SessionVNC 如何断开已连接的 RDP 会话
【发布时间】:2010-11-06 22:01:03
【问题描述】:

在将 VNC 与 RDP 结合使用时,我注意到 VNC 的一种行为,即当您使用 RDP (mstsc) 连接到一台机器,然后您想使用 VNC 连接到该机器时,它会断开连接RDP 会话,您将在目标计算机上看到屏幕闪烁(黑屏一秒钟),然后您通过 VNC 连接,我想知道 VNC 如何断开活动的 RDP 会话,任何代码 sn-p会很有帮助的.. 谢谢

【问题讨论】:

    标签: vnc mstsc


    【解决方案1】:

    当您使用 VNC 连接时,它会尝试使用 WinStationConnectW(未记录)连接到控制台会话,这将断开 RDP 会话。

    Here is a snippet 来自TightVNC

      void setConsoleSession(DWORD sessionId) {
    #ifdef RFB_HAVE_WINSTATION_CONNECT
        if (!_WinStationConnect.isValid())
          throw rdr::Exception("WinSta APIs missing");
        if (sessionId == -1)
          sessionId = mySessionId.id;
    
        // Try to reconnect our session to the console
        ConsoleSessionId console;
        vlog.info("Console session is %d", console.id);
        if (!(*_WinStationConnect)(0, sessionId, console.id, L"", 0))
          throw rdr::SystemException("Unable to connect session to Console", GetLastError());
    
        // Lock the newly connected session, for security
        if (_LockWorkStation.isValid())
          (*_LockWorkStation)();
    #else
        throw rdr::Exception("setConsoleSession not implemented");
    #endif
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-31
      • 1970-01-01
      • 2021-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-21
      • 1970-01-01
      相关资源
      最近更新 更多