- Timestamp:
- Jun 7, 2010 6:36:26 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
r30013 r30049 37 37 38 38 39 /******************************************************************************* 40 * Structures and Typedefs * 41 *******************************************************************************/ 39 42 /** Structure for storing the looked up user information. */ 40 43 typedef struct … … 44 47 WCHAR wszLogonDomain[_MAX_PATH]; 45 48 } VBOXSERVICEVMINFOUSER, *PVBOXSERVICEVMINFOUSER; 49 46 50 /** Structure for the file information lookup. */ 47 51 typedef struct … … 50 54 char *pszFileName; 51 55 } VBOXSERVICEVMINFOFILE, *PVBOXSERVICEVMINFOFILE; 56 52 57 /** Structure for process information lookup. */ 53 58 typedef struct … … 66 71 void VBoxServiceVMInfoWinProcessesFree(PVBOXSERVICEVMINFOPROC paProcs); 67 72 68 69 /*******************************************************************************70 * Global Variables *71 *******************************************************************************/72 73 73 74 … … 406 407 &cbRet)) 407 408 { 408 if (cbRet)409 if (cbRet) 409 410 iState = *pBuffer; 410 411 VBoxServiceVerbose(3, "VMInfo/Users: Account User=%ls, WTSConnectState=%d\n", … … 449 450 * 450 451 * @returns VBox status code. 451 * @param ppszUserList Where to store the user list (separated by commas). Must be452 * freed with RTStrFree().452 * @param ppszUserList Where to store the user list (separated by commas). 453 * Must be freed with RTStrFree(). 453 454 * @param pcUsersInList Where to store the number of users in the list. 454 455 */ … … 457 458 PLUID paSessions = NULL; 458 459 ULONG cSession = 0; 459 NTSTATUS r = 0;460 460 461 461 /* This function can report stale or orphaned interactive logon sessions 462 462 of already logged off users (especially in Windows 2000). */ 463 r= LsaEnumerateLogonSessions(&cSession, &paSessions);463 NTSTATUS rcNt = LsaEnumerateLogonSessions(&cSession, &paSessions); 464 464 VBoxServiceVerbose(3, "VMInfo/Users: Found %ld users\n", cSession); 465 if (r != STATUS_SUCCESS)466 { 467 VBoxServiceError("VMInfo/Users: LsaEnumerate failed with %lu\n", LsaNtStatusToWinError(r ));468 return RTErrConvertFromWin32(LsaNtStatusToWinError(r ));465 if (rcNt != STATUS_SUCCESS) 466 { 467 VBoxServiceError("VMInfo/Users: LsaEnumerate failed with %lu\n", LsaNtStatusToWinError(rcNt)); 468 return RTErrConvertFromWin32(LsaNtStatusToWinError(rcNt)); 469 469 } 470 470 … … 484 484 { 485 485 rc = RTStrAAppend(ppszUserList, ","); 486 AssertRC Return(rc, rc);486 AssertRCBreakStmt(rc, RTStrFree(*ppszUserList)); 487 487 } 488 488 … … 495 495 rc = RTStrAAppend(ppszUserList, pszTemp); 496 496 RTMemFree(pszTemp); 497 AssertRCReturn(rc, rc);498 497 } 499 498 else 500 RTStrAAppend(ppszUserList, "<string-convertion-error>"); 499 rc = RTStrAAppend(ppszUserList, "<string-convertion-error>"); 500 AssertRCBreakStmt(rc, RTStrFree(*ppszUserList)); 501 501 } 502 502 }
Note:
See TracChangeset
for help on using the changeset viewer.