private void ConnectHostedConsole(VNCGraphicsClient v, Console console) { Program.AssertOffEventThread(); Host host = console.Connection.Resolve(Source.resident_on); if (host == null) { throw new Failure(Failure.INTERNAL_ERROR, Messages.VNC_HOST_GONE); } Uri uri = new Uri(console.location); String SessionUUID; lock (activeSessionLock) { // use the elevated credentials, if provided, for connecting to the console (CA-91132) activeSession = (string.IsNullOrEmpty(ElevatedUsername) || string.IsNullOrEmpty(ElevatedPassword)) ? console.Connection.DuplicateSession() : console.Connection.ElevatedSession(ElevatedUsername, ElevatedPassword); SessionUUID = activeSession.uuid; } Stream stream = HTTPHelper.CONNECT(uri, console.Connection, SessionUUID, false, true); InvokeConnection(v, stream, console); }