Changeset 20698 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Jun 18, 2009 7:55:01 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48803
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
r19374 r20698 182 182 if (r != STATUS_SUCCESS) 183 183 { 184 VBoxServiceError("LsaGetLogonSessionData failed %lu\n", LsaNtStatusToWinError(r));184 VBoxServiceError("LsaGetLogonSessionData failed, LSA error %lu\n", LsaNtStatusToWinError(r)); 185 185 186 186 if (sessionData) … … 196 196 } 197 197 198 VBoxServiceVerbose(3, " vboxVMInfoThread:Users: Session data: Name = %ls, Len = %d, SID = %s, LogonID = %d,%d\n",198 VBoxServiceVerbose(3, "Users: Session data: Name = %ls, Len = %d, SID = %s, LogonID = %d,%d\n", 199 199 (sessionData->UserName).Buffer, (sessionData->UserName).Length, (sessionData->Sid != NULL) ? "1" : "0", sessionData->LogonId.HighPart, sessionData->LogonId.LowPart); 200 200 … … 281 281 &dwBytesRet)) 282 282 { 283 /*VBoxServiceVerbose(3, (" vboxVMInfoThread:Users: WTSQuerySessionInformation returned %ld bytes, p=%p, state=%d\n", dwBytesRet, pBuffer, pBuffer != NULL ? (INT)*pBuffer : -1));*/283 /*VBoxServiceVerbose(3, ("Users: WTSQuerySessionInformation returned %ld bytes, p=%p, state=%d\n", dwBytesRet, pBuffer, pBuffer != NULL ? (INT)*pBuffer : -1));*/ 284 284 if(dwBytesRet) 285 285 iState = *pBuffer; … … 291 291 /** @todo On Vista and W2K, always "old" user name are still 292 292 * there. Filter out the old one! */ 293 VBoxServiceVerbose(3, " vboxVMInfoThread:Users: Account User=%ls is logged in via TCS/RDP. State=%d\n", a_pUserInfo->szUser, iState);293 VBoxServiceVerbose(3, "Users: Account User=%ls is logged in via TCS/RDP. State=%d\n", a_pUserInfo->szUser, iState); 294 294 bFoundUser = TRUE; 295 295 } … … 333 333 334 334 HKEY hKey = NULL; 335 intrc = 0;335 long rc = 0; 336 336 DWORD dwSize = 0; 337 337 DWORD dwType = 0; 338 339 /* First try the old registry path ... */ 338 340 rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 339 if ((rc != ERROR_SUCCESS ) && (rc != ERROR_FILE_NOT_FOUND)) 340 { 341 if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND)) 342 { 343 /* Old registry path does not exist -- maybe the new one does? */ 341 344 rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 342 if ((rc != ERROR_SUCCESS 343 { 344 VBoxServiceError("Failed to open registry key (guest additions)! Error: %d\n", GetLastError());345 if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND)) 346 { 347 VBoxServiceError("Failed to open registry key (guest additions)! Error: %d\n", rc); 345 348 return 1; 346 349 } … … 349 352 /* Installation directory. */ 350 353 dwSize = sizeof(szInstDir); 351 rc = RegQueryValueExA (hKey, "InstallDir", 0, 0, (BYTE*)(LPCTSTR)szInstDir, &dwSize);352 if ((rc != ERROR_SUCCESS 354 rc = RegQueryValueExA (hKey, "InstallDir", NULL, &dwType, (BYTE*)(LPCTSTR)szInstDir, &dwSize); 355 if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND)) 353 356 { 354 357 RegCloseKey (hKey); 355 VBoxServiceError("Failed to query registry key (install directory)! Error: %d\n", GetLastError());358 VBoxServiceError("Failed to query registry key (install directory)! Error: %d\n", rc); 356 359 return 1; 357 360 } … … 364 367 /* Revision. */ 365 368 dwSize = sizeof(szRev); 366 rc = RegQueryValueExA (hKey, "Revision", 0, 0, (BYTE*)(LPCTSTR)szRev, &dwSize);367 if ((rc != ERROR_SUCCESS 369 rc = RegQueryValueExA (hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)szRev, &dwSize); 370 if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND)) 368 371 { 369 372 RegCloseKey (hKey); 370 VBoxServiceError("Failed to query registry key (revision)! Error: %d\n", GetLastError());373 VBoxServiceError("Failed to query registry key (revision)! Error: %d\n", rc); 371 374 return 1; 372 375 } … … 374 377 /* Version. */ 375 378 dwSize = sizeof(szVer); 376 rc = RegQueryValueExA (hKey, "Version", 0, 0, (BYTE*)(LPCTSTR)szVer, &dwSize);377 if ((rc != ERROR_SUCCESS 379 rc = RegQueryValueExA (hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)szVer, &dwSize); 380 if ((rc != ERROR_SUCCESS) && (rc != ERROR_FILE_NOT_FOUND)) 378 381 { 379 382 RegCloseKey (hKey); 380 VBoxServiceError("Failed to query registry key (version)! Error: %Rrc\n", GetLastError());383 VBoxServiceError("Failed to query registry key (version)! Error: %Rrc\n", rc); 381 384 return 1; 382 385 }
Note:
See TracChangeset
for help on using the changeset viewer.