Changeset 24372 in vbox for trunk/src/VBox
- Timestamp:
- Nov 5, 2009 9:41:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r24332 r24372 242 242 * Try get the *installed* version first. 243 243 */ 244 int rc = VINF_SUCCESS;245 244 HKEY hKey; 246 245 LONG r; … … 270 269 271 270 /* Did we get something worth looking at? */ 271 int rc; 272 272 if (r == ERROR_SUCCESS) 273 273 { … … 284 284 DWORD dwType; 285 285 DWORD dwSize = 32; 286 char *pszTmp; 286 287 if (ppszVer) 287 288 { 288 char *pszVer= (char*)RTMemAlloc(dwSize);289 if (psz Ver)289 pszTmp = (char*)RTMemAlloc(dwSize); 290 if (pszTmp) 290 291 { 291 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize)) 292 *ppszVer = pszVer; 292 r = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); 293 if (r == ERROR_SUCCESS) 294 rc = RTStrDupEx(ppszVer, pszTmp); 295 else 296 rc = RTErrConvertFromNtStatus(r); 297 RTMemFree(pszTmp); 293 298 } 299 else 300 rc = VERR_NO_MEMORY; 294 301 } 295 302 /* Revision. */ … … 297 304 { 298 305 dwSize = 32; /* Reset */ 299 char *pszRev= (char*)RTMemAlloc(dwSize);300 if (psz Rev)306 pszTmp = (char*)RTMemAlloc(dwSize); 307 if (pszTmp) 301 308 { 302 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize)) 303 *ppszRev = pszRev; 309 r = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); 310 if (r == ERROR_SUCCESS) 311 rc = RTStrDupEx(ppszRev, pszTmp); 312 else 313 rc = RTErrConvertFromNtStatus(r); 314 RTMemFree(pszTmp); 304 315 } 316 else 317 rc = VERR_NO_MEMORY; 305 318 } 306 319 }
Note:
See TracChangeset
for help on using the changeset viewer.