Changeset 40414 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Mar 9, 2012 2:13:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp
r40211 r40414 57 57 int rc = VbglR3ReportAdditionsStatus(VBoxGuestFacilityType_AutoLogon, 58 58 enmStatus, 0 /* Flags */); 59 if (RT_FAILURE(rc)) 60 return rc; 59 if (rc == VERR_NOT_SUPPORTED) 60 { 61 /* 62 * To maintain backwards compatibility to older hosts which don't have 63 * VMMDevReportGuestStatus implemented we set the appropriate status via 64 * guest property to have at least something. 65 */ 66 uint32_t u32ClientId = 0; 67 rc = VbglR3GuestPropConnect(&u32ClientId); 68 if (RT_SUCCESS(rc)) 69 { 70 /** @todo Move VBoxGuestStatusCurrent -> const char* to an own function. */ 71 char szStatus[RTPATH_MAX]; 72 size_t cbRet = 0; 73 switch (enmStatus) 74 { 75 case VBoxGuestFacilityStatus_Inactive: 76 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Inactive"); 77 break; 78 case VBoxGuestFacilityStatus_Paused: 79 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Disabled"); 80 break; 81 case VBoxGuestFacilityStatus_PreInit: 82 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "PreInit"); 83 break; 84 case VBoxGuestFacilityStatus_Init: 85 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Init"); 86 break; 87 case VBoxGuestFacilityStatus_Active: 88 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Active"); 89 break; 90 case VBoxGuestFacilityStatus_Terminating: 91 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Terminating"); 92 break; 93 case VBoxGuestFacilityStatus_Terminated: 94 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Terminated"); 95 break; 96 case VBoxGuestFacilityStatus_Failed: 97 cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Failed"); 98 break; 99 default: 100 /* cbRet will be 0. */ 101 break; 102 } 103 104 if (cbRet) 105 { 106 const char szPath[] = "/VirtualBox/GuestInfo/OS/AutoLogonStatus"; 107 108 /* 109 * Because a value can be temporary we have to make sure it also 110 * gets deleted when the property cache did not have the chance to 111 * gracefully clean it up (due to a hard VM reset etc), so set this 112 * guest property using the TRANSRESET flag.. 113 */ 114 rc = VbglR3GuestPropWrite(u32ClientId, szPath, szStatus, "TRANSRESET"); 115 if (rc == VERR_PARSE_ERROR) 116 { 117 /* Host does not support the "TRANSRESET" flag, so only 118 * use the "TRANSIENT" flag -- better than nothing :-). */ 119 rc = VbglR3GuestPropWrite(u32ClientId, szPath, szStatus, "TRANSIENT"); 120 } 121 } 122 else 123 rc = VERR_INVALID_PARAMETER; 124 125 VbglR3GuestPropDisconnect(u32ClientId); 126 } 127 } 61 128 62 129 s_enmLastStatus = enmStatus;
Note:
See TracChangeset
for help on using the changeset viewer.