Changeset 23839 in vbox
- Timestamp:
- Oct 17, 2009 8:21:39 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53597
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r23835 r23839 98 98 VBoxGuestR3Lib.cpp \ 99 99 VBoxGuestR3LibGR.cpp \ 100 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 100 $(if $(VBOX_WITH_GUEST_PROPS), \ 101 VBoxGuestR3LibGuestProp.cpp \ 102 VBoxGuestR3LibHostVersion.cpp,) \ 101 103 VBoxGuestR3LibMisc.cpp \ 102 104 VBoxGuestR3LibTime.cpp -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
r23837 r23839 41 41 * @returns 0 if equal, 1 if Ver1 is greater, 2 if Ver2 is greater. 42 42 * 43 * @param pszVer1 43 * @param pszVer1 First version string to compare. 44 44 * @param pszVer2 First version string to compare. 45 45 * … … 146 146 LogFlow(("Update found.")); 147 147 } 148 else rc = VERR_VERSION_MISMATCH; /* No update found.*/148 else rc = VERR_VERSION_MISMATCH; /* No update found */ 149 149 } 150 150 } … … 153 153 if (RT_FAILURE(rc)) 154 154 { 155 156 157 158 155 if (*ppszHostVersion) 156 VbglR3GuestPropReadValueFree(*ppszHostVersion); 157 if (*ppszGuestVersion) 158 VbglR3GuestPropReadValueFree(*ppszGuestVersion); 159 159 } 160 160 return rc == VINF_SUCCESS ? true : false; … … 171 171 if (RT_FAILURE(rc)) 172 172 { 173 LogFlow(("Failed to connect to the guest property service! Error: %d\n", rc));173 LogFlow(("Failed to connect to the guest property service! Error: %d\n", rc)); 174 174 } 175 175 else 176 176 { 177 177 #ifdef RT_OS_WINDOWS 178 179 180 181 182 183 184 185 186 187 188 189 190 191 lRet = RegSetValueEx(hKey, "HostVerLastChecked", 0, REG_SZ, (BYTE*)pszVBoxHostVer, (DWORD)(strlen(pszVBoxHostVer)*sizeof(char)));192 193 194 195 196 197 198 199 200 178 HKEY hKey; 179 long lRet; 180 lRet = RegCreateKeyEx (HKEY_LOCAL_MACHINE, 181 "SOFTWARE\\Sun\\VirtualBox Guest Additions", 182 0, /* Reserved */ 183 NULL, /* lpClass [in, optional] */ 184 0, /* dwOptions [in] */ 185 KEY_WRITE, 186 NULL, /* lpSecurityAttributes [in, optional] */ 187 &hKey, 188 NULL); /* lpdwDisposition [out, optional] */ 189 if (lRet == ERROR_SUCCESS) 190 { 191 lRet = RegSetValueEx(hKey, "HostVerLastChecked", 0, REG_SZ, (BYTE*)pszVer, (DWORD)(strlen(pszVer)*sizeof(char))); 192 if (lRet != ERROR_SUCCESS) 193 LogFlow(("Could not write HostVerLastChecked! Error = %ld\n", lRet)); 194 RegCloseKey(hKey); 195 } 196 else 197 LogFlow(("Could not open registry key! Error = %ld\n", lRet)); 198 199 if (lRet != ERROR_SUCCESS) 200 rc = RTErrConvertFromWin32(lRet); 201 201 #else 202 202 #endif -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r23838 r23839 235 235 { 236 236 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize)) 237 ppszVer = pszVer;237 *ppszVer = pszVer; 238 238 } 239 239 /* Revision. */ … … 241 241 { 242 242 dwSize = 32; 243 char pszRev = (char*)RTMemAlloc(dwSize);243 char *pszRev = (char*)RTMemAlloc(dwSize); 244 244 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize)) 245 ppszRev = pszRev;245 *ppszRev = pszRev; 246 246 } 247 247 }
Note:
See TracChangeset
for help on using the changeset viewer.