- Timestamp:
- Jul 2, 2009 2:09:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r19637 r21166 110 110 111 111 int rc = RTSemEventMultiCreate(&g_VMInfoEvent); 112 AssertRC (rc);112 AssertRCReturn(rc, rc); 113 113 114 114 #ifdef RT_OS_WINDOWS … … 123 123 124 124 rc = VbglR3GuestPropConnect(&g_VMInfoGuestPropSvcClientID); 125 if (!RT_SUCCESS(rc)) 125 if (RT_SUCCESS(rc)) 126 VBoxServiceVerbose(3, "Property Service Client ID: %#x\n", g_VMInfoGuestPropSvcClientID); 127 else 126 128 { 127 129 VBoxServiceError("Failed to connect to the guest property service! Error: %Rrc\n", rc); 128 } 129 else 130 { 131 VBoxServiceVerbose(3, "Property Service Client ID: %ld\n", g_VMInfoGuestPropSvcClientID); 130 RTSemEventMultiDestroy(g_VMInfoEvent); 131 g_VMInfoEvent = NIL_RTSEMEVENTMULTI; 132 132 } 133 133 … … 437 437 int rc; 438 438 439 /** @todo temporary solution: Zap all values which are not valid440 * anymore when VM goes down (reboot/shutdown ). Needs to441 * be replaced with "temporary properties" later. */442 rc = VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsersList", NULL);443 rc = VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsers", 0);444 if (g_VMInfoLoggedInUsers > 0)445 VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/NoLoggedInUsers", "true");446 447 const char *apszPat[1] = { "/VirtualBox/GuestInfo/Net/*" };448 rc = VbglR3GuestPropDelSet(g_VMInfoGuestPropSvcClientID, &apszPat[0], RT_ELEMENTS(apszPat));449 rc = VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, "GuestInfo/Net/Count", 0);450 451 /* Disconnect from guest properties service. */452 rc = VbglR3GuestPropDisconnect(g_VMInfoGuestPropSvcClientID);453 if (RT_FAILURE(rc))454 VBoxServiceError("Failed to disconnect from guest property service! Error: %Rrc\n", rc);455 456 439 if (g_VMInfoEvent != NIL_RTSEMEVENTMULTI) 457 440 { 441 /** @todo temporary solution: Zap all values which are not valid 442 * anymore when VM goes down (reboot/shutdown ). Needs to 443 * be replaced with "temporary properties" later. 444 * 445 * @todo r=bird: This code isn't called on non-Windows systems. We need 446 * a more formal way of shutting down the service for that to work. 447 */ 448 rc = VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsersList", NULL); 449 rc = VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsers", 0); 450 if (g_VMInfoLoggedInUsers > 0) 451 VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/NoLoggedInUsers", "true"); 452 453 const char *apszPat[1] = { "/VirtualBox/GuestInfo/Net/*" }; 454 rc = VbglR3GuestPropDelSet(g_VMInfoGuestPropSvcClientID, &apszPat[0], RT_ELEMENTS(apszPat)); 455 rc = VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, "GuestInfo/Net/Count", 0); 456 457 /* Disconnect from guest properties service. */ 458 rc = VbglR3GuestPropDisconnect(g_VMInfoGuestPropSvcClientID); 459 if (RT_FAILURE(rc)) 460 VBoxServiceError("Failed to disconnect from guest property service! Error: %Rrc\n", rc); 461 g_VMInfoGuestPropSvcClientID = 0; 462 463 458 464 RTSemEventMultiDestroy(g_VMInfoEvent); 459 465 g_VMInfoEvent = NIL_RTSEMEVENTMULTI;
Note:
See TracChangeset
for help on using the changeset viewer.