Changeset 36249 in vbox for trunk/src/VBox
- Timestamp:
- Mar 10, 2011 12:18:20 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
r36219 r36249 99 99 if (RTStrAPrintfV(&pszValue, pszValueFormat, va) >= 0) 100 100 { 101 if (fFlags & VBOXSERVICEPROPCACHEFLAG_T EMPORARY)101 if (fFlags & VBOXSERVICEPROPCACHEFLAG_TRANSIENT) 102 102 { 103 103 /* … … 118 118 } 119 119 else 120 rc = VbglR3GuestPropWriteValue(u32ClientId, pszName, pszValue );120 rc = VbglR3GuestPropWriteValue(u32ClientId, pszName, pszValue /* No transient flags set */); 121 121 RTStrFree(pszValue); 122 122 } … … 383 383 RTListNodeRemove(&pNode->NodeSucc); 384 384 385 /*386 * When destroying the cache and we have a temporary value, remove the387 * (eventually) set TRANSIENT_RESET flag from it so that it doesn't get deleted388 * by the host side in order to put the actual reset value in it.389 */390 385 if (pNode->fFlags & VBOXSERVICEPROPCACHEFLAG_TEMPORARY) 391 vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, 0 /* Flags, clear all */, pNode->pszValueReset); 386 { 387 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, 388 pNode->fFlags, pNode->pszValueReset); 389 } 392 390 393 391 AssertPtr(pNode->pszName); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.h
r36178 r36249 24 24 25 25 /** Indicates wheter a guest property is temporary and either should 26 * get deleted when 27 * - a) the property cache gets destroyed, or 28 * - b) the VM gets a hard reset / shutdown 29 * or gets a default "reset" value (if specified via VBoxServicePropCacheUpdateEntry) 30 * when the property cache gets properly destroyed. 26 * - a) get a "reset" value assigned (via VBoxServicePropCacheUpdateEntry) 27 * as soon as the property cache gets destroyed, or 28 * - b) get deleted when no reset value is specified. 31 29 */ 32 #define VBOXSERVICEPROPCACHEFLAG_TEMPORARY RT_BIT(1)30 #define VBOXSERVICEPROPCACHEFLAG_TEMPORARY RT_BIT(1) 33 31 /** Indicates whether a property every time needs to be updated, regardless 34 32 * if its real value changed or not. */ 35 #define VBOXSERVICEPROPCACHEFLAG_ALWAYS_UPDATE RT_BIT(2) 33 #define VBOXSERVICEPROPCACHEFLAG_ALWAYS_UPDATE RT_BIT(2) 34 /** The guest property gets deleted when 35 * - a) the property cache gets destroyed, or 36 * - b) the VM gets reset / shutdown / destroyed. 37 */ 38 #define VBOXSERVICEPROPCACHEFLAG_TRANSIENT RT_BIT(3) 36 39 37 40 int VBoxServicePropCacheCreate(PVBOXSERVICEVEPROPCACHE pCache, uint32_t uClientId); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r33554 r36249 147 147 */ 148 148 VBoxServicePropCacheUpdateEntry(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", 149 VBOXSERVICEPROPCACHEFLAG_TEMPORARY , NULL /* Delete on exit */);149 VBOXSERVICEPROPCACHEFLAG_TEMPORARY | VBOXSERVICEPROPCACHEFLAG_TRANSIENT, NULL /* Delete on exit */); 150 150 VBoxServicePropCacheUpdateEntry(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsers", 151 VBOXSERVICEPROPCACHEFLAG_TEMPORARY , "0");151 VBOXSERVICEPROPCACHEFLAG_TEMPORARY | VBOXSERVICEPROPCACHEFLAG_TRANSIENT, "0"); 152 152 VBoxServicePropCacheUpdateEntry(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/NoLoggedInUsers", 153 VBOXSERVICEPROPCACHEFLAG_TEMPORARY , "true");153 VBOXSERVICEPROPCACHEFLAG_TEMPORARY | VBOXSERVICEPROPCACHEFLAG_TRANSIENT, "true"); 154 154 VBoxServicePropCacheUpdateEntry(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/Net/Count", 155 155 VBOXSERVICEPROPCACHEFLAG_TEMPORARY | VBOXSERVICEPROPCACHEFLAG_ALWAYS_UPDATE, NULL /* Delete on exit */); -
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.