Changeset 36249 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 10, 2011 12:18:20 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70483
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r35741 r36249 208 208 if (fProcessDisconnectOnGuestLogout) 209 209 { 210 bool fDropConnection = false; 211 210 212 Bstr value; 211 213 gpcev->COMGETTER(Value)(value.asOutParam()); … … 216 218 { 217 219 mfNoLoggedInUsers = true; 218 219 /* If there is a connection, drop it. */ 220 ComPtr<IVRDEServerInfo> info; 221 hrc = gConsole->COMGETTER(VRDEServerInfo)(info.asOutParam()); 222 if (SUCCEEDED(hrc) && info) 223 { 224 ULONG cClients = 0; 225 hrc = info->COMGETTER(NumberOfClients)(&cClients); 226 if (SUCCEEDED(hrc) && cClients > 0) 227 { 228 ComPtr <IVRDEServer> vrdeServer; 229 hrc = machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 230 if (SUCCEEDED(hrc) && vrdeServer) 231 { 232 LogRel(("VRDE: the guest user has logged out, disconnecting remote clients.\n")); 233 vrdeServer->COMSETTER(Enabled)(FALSE); 234 vrdeServer->COMSETTER(Enabled)(TRUE); 235 } 236 } 237 } 220 fDropConnection = true; 238 221 } 222 } 223 /* Guest property got deleted due to hard reset, 224 * so it has no value anymore. */ 225 else if (utf8Value.isEmpty()) 226 { 227 fDropConnection = true; 239 228 } 240 229 else 241 230 { 242 231 mfNoLoggedInUsers = false; 232 } 233 234 if (fDropConnection) 235 { 236 /* If there is a connection, drop it. */ 237 ComPtr<IVRDEServerInfo> info; 238 hrc = gConsole->COMGETTER(VRDEServerInfo)(info.asOutParam()); 239 if (SUCCEEDED(hrc) && info) 240 { 241 ULONG cClients = 0; 242 hrc = info->COMGETTER(NumberOfClients)(&cClients); 243 if (SUCCEEDED(hrc) && cClients > 0) 244 { 245 ComPtr <IVRDEServer> vrdeServer; 246 hrc = machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 247 if (SUCCEEDED(hrc) && vrdeServer) 248 { 249 LogRel(("VRDE: the guest user has logged out, disconnecting remote clients.\n")); 250 vrdeServer->COMSETTER(Enabled)(FALSE); 251 vrdeServer->COMSETTER(Enabled)(TRUE); 252 } 253 } 254 } 243 255 } 244 256 } … … 532 544 #endif /* VBOX_FFMPEG defined */ 533 545 534 #ifdef RT_OS_WINDOWS 546 #ifdef RT_OS_WINDOWS 535 547 // Required for ATL 536 548 static CComModule _Module; … … 1326 1338 pVirtualBoxClient.setNull(); 1327 1339 machine.setNull(); 1328 1340 1329 1341 com::Shutdown(); 1330 1342
Note:
See TracChangeset
for help on using the changeset viewer.