VirtualBox

Changeset 102661 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Dec 20, 2023 6:21:40 PM (14 months ago)
Author:
vboxsync
Message:

IPRT/RTFsMountpointsEnum: Gracefully skip volumes a regular user does not have access to, instead of failing completely. We might want to have a flag for that (later). ​bugref:10415

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/RTFsMountpointsEnum-win.cpp

    r102660 r102661  
    178178                g_pfnFindVolumeMountPointClose(hMp);
    179179            }
    180             else if (   GetLastError() != ERROR_NO_MORE_FILES
    181                      && GetLastError() != ERROR_PATH_NOT_FOUND
    182                      && GetLastError() != ERROR_UNRECOGNIZED_VOLUME)
    183                 rc = RTErrConvertFromWin32(GetLastError());
     180            else
     181            {
     182                DWORD const dwErr = GetLastError();
     183                if (   dwErr != ERROR_NO_MORE_FILES
     184                    && dwErr != ERROR_PATH_NOT_FOUND
     185                    && dwErr != ERROR_UNRECOGNIZED_VOLUME
     186                    && dwErr != ERROR_ACCESS_DENIED) /* Can happen for regular users, so just skip this stuff then. */
     187                    rc = RTErrConvertFromWin32(GetLastError());
     188            }
    184189
    185190            if (RT_SUCCESS(rc))
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