Changeset 23837 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Oct 16, 2009 10:54:47 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
r23835 r23837 198 198 199 199 if (lRet != ERROR_SUCCESS) 200 200 rc = RTErrConvertFromWin32(lRet); 201 201 #else 202 202 #endif -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r23836 r23837 200 200 #ifdef RT_OS_WINDOWS 201 201 HKEY hKey; 202 LONG r; 202 203 203 204 /* Check the new path first. */ 204 r c= RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);205 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 205 206 #ifdef RT_ARCH_AMD64 206 if (r c!= ERROR_SUCCESS)207 if (r != ERROR_SUCCESS) 207 208 { 208 209 /* Check Wow6432Node (for new entries). */ 209 r c= RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);210 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 210 211 } 211 212 #endif 212 213 213 214 /* Still no luck? Then try the old xVM paths ... */ 214 if ( RT_FAILURE(rc))215 { 216 r c= RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);215 if (FAILED(r)) 216 { 217 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 217 218 #ifdef RT_ARCH_AMD64 218 if (r c!= ERROR_SUCCESS)219 if (r != ERROR_SUCCESS) 219 220 { 220 221 /* Check Wow6432Node (for new entries). */ 221 r c= RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);222 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 222 223 } 223 224 #endif … … 225 226 226 227 /* Did we get something worth looking at? */ 227 if ( RT_SUCCESS(rc))228 if (SUCCEEDED(r)) 228 229 { 229 230 /* Version. */ 230 231 DWORD dwType; 231 232 DWORD dwSize = 32; 232 ppszVer = (char*)RTMemAlloc(dwSize); 233 rc = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)*ppszVer, &dwSize); 233 char *pszVer = (char*)RTMemAlloc(dwSize); 234 if (pszVer) 235 { 236 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize)) 237 ppszVer = pszVer; 238 } 234 239 /* Revision. */ 235 240 if (ppszRev) 236 241 { 237 242 dwSize = 32; 238 ppszRev = (char*)RTMemAlloc(dwSize); 239 rc = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)*ppszRev, &dwSize); 243 char pszRev = (char*)RTMemAlloc(dwSize); 244 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize)) 245 ppszRev = pszRev; 240 246 } 241 247 } 248 rc = RTErrConvertFromWin32(r); 242 249 243 250 if (NULL != hKey)
Note:
See TracChangeset
for help on using the changeset viewer.