VirtualBox

Changeset 32771 in vbox


Ignore:
Timestamp:
Sep 27, 2010 12:09:42 PM (14 years ago)
Author:
vboxsync
Message:

VBoxService/VMInfo: Fixed LsaEnumerate() error case when shutting down the system, return rc.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp

    r32431 r32771  
    470470       of already logged off users (especially in Windows 2000). */
    471471    NTSTATUS rcNt = LsaEnumerateLogonSessions(&cSession, &paSessions);
     472    if (rcNt != STATUS_SUCCESS)
     473    {
     474        ULONG rcWin = LsaNtStatusToWinError(rcNt);
     475
     476        /* If we're about to shutdown when we were in the middle of enumerating the logon
     477           sessions, skip the error to not confuse the user with an unnecessary log message. */
     478        if (rcWin == ERROR_SHUTDOWN_IN_PROGRESS)
     479        {
     480            VBoxServiceVerbose(3, "VMInfo/Users: Shutdown in progress ...\n");
     481            rcWin = ERROR_SUCCESS;
     482        }
     483        else
     484            VBoxServiceError("VMInfo/Users: LsaEnumerate failed with %lu\n", rcWin);
     485        return RTErrConvertFromWin32(rcWin);
     486    }
    472487    VBoxServiceVerbose(3, "VMInfo/Users: Found %ld users\n", cSession);
    473     if (rcNt != STATUS_SUCCESS)
    474     {
    475         VBoxServiceError("VMInfo/Users: LsaEnumerate failed with %lu\n", LsaNtStatusToWinError(rcNt));
    476         return RTErrConvertFromWin32(LsaNtStatusToWinError(rcNt));
    477     }
    478488
    479489    PVBOXSERVICEVMINFOPROC  paProcs;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r32731 r32771  
    332332    if (RT_SUCCESS(rc) && pszUserList)
    333333        RTStrFree(pszUserList);
    334     return VINF_SUCCESS;
     334    return rc;
    335335}
    336336
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette