Changeset 23115 in vbox
- Timestamp:
- Sep 18, 2009 8:27:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp
r23113 r23115 59 59 Log(("VBoxTray: Failed to connect to the guest property service! Error: %d\n", rc)); 60 60 61 /* Do we need to do all this stuff? */ 62 char *pszCheckHostVersion; 63 rc = VbglR3GuestPropReadValueAlloc(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/CheckHostVersion", &pszCheckHostVersion); 64 if (RT_FAILURE(rc)) 65 { 66 if (rc == VERR_NOT_FOUND) 67 rc = VERR_NOT_SUPPORTED; /* If we don't find the value above this is not critical */ 68 else 69 Log(("VBoxTray: Could not read check host version flag! rc = %d\n", rc)); 70 } 71 else 72 { 73 if (pszCheckHostVersion && atoi(pszCheckHostVersion) <= 0) 74 rc = VERR_NOT_SUPPORTED; 75 VbglR3GuestPropReadValueFree(pszCheckHostVersion); 76 } 77 if (rc == VERR_NOT_SUPPORTED) 78 Log(("VBoxTray: No host version check performed.")); 79 61 80 char szMsg[256] = "\0"; /* Sizes according to MSDN. */ 62 81 char szTitle[64] = "\0"; … … 68 87 rc = VbglR3GuestPropReadValueAlloc(uGuestPropSvcClientID, "/VirtualBox/HostInfo/VBoxVer", &pszVBoxHostVer); 69 88 if (RT_FAILURE(rc)) 70 Log(("VBoxTray: Could not read VBox host version! rc = %d\n", rc)); 71 72 if (RT_SUCCESS(rc)) 89 { 90 Log(("VBoxTray: Could not read VBox host version! rc = %d\n", rc)); 91 } 92 else 73 93 { 74 94 Log(("VBoxTray: Host version: %s\n", pszVBoxHostVer)); … … 102 122 } 103 123 104 /** @todo implement a special value of last informed host version (or a new flag) to disable this service. */105 106 124 /* Compare both versions and prepare message */ 107 125 if ( RT_SUCCESS(rc) … … 129 147 if (lRet == ERROR_SUCCESS) 130 148 { 131 lRet = RegSetValueEx(hKey, "HostVerLastChecked", 0, REG_SZ, (BYTE*)pszVBoxHostVer, strlen(pszVBoxHostVer)*sizeof(char));149 lRet = RegSetValueEx(hKey, "HostVerLastChecked", 0, REG_SZ, (BYTE*)pszVBoxHostVer, (DWORD)(strlen(pszVBoxHostVer)*sizeof(char))); 132 150 if (lRet != ERROR_SUCCESS) 133 151 Log(("VBoxTray: Could not write HostVerLastChecked! Error = %ld\n", lRet)); … … 153 171 } 154 172 173 /* If we didn't have to check for the host version then this is not an error */ 174 if (rc == VERR_NOT_SUPPORTED) 175 rc = VINF_SUCCESS; 176 155 177 VbglR3GuestPropDisconnect(uGuestPropSvcClientID); 156 178 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.