diff --git a/modules/rostests/apitests/mountmgr/QueryDosVolumePaths.c b/modules/rostests/apitests/mountmgr/QueryDosVolumePaths.c index 138e45bd56e..e7103b121e7 100644 --- a/modules/rostests/apitests/mountmgr/QueryDosVolumePaths.c +++ b/modules/rostests/apitests/mountmgr/QueryDosVolumePaths.c @@ -571,7 +571,7 @@ START_TEST(QueryDosVolumePaths) HANDLE hFindVolume; WCHAR szVolumeName[MAX_PATH]; - MountMgrHandle = GetMountMgrHandle(); + MountMgrHandle = GetMountMgrHandle(FILE_READ_ATTRIBUTES); if (!MountMgrHandle) { win_skip("MountMgr unavailable: %lu\n", GetLastError()); diff --git a/modules/rostests/apitests/mountmgr/QueryPoints.c b/modules/rostests/apitests/mountmgr/QueryPoints.c index ad6b433878d..a34e27f8ca4 100644 --- a/modules/rostests/apitests/mountmgr/QueryPoints.c +++ b/modules/rostests/apitests/mountmgr/QueryPoints.c @@ -36,7 +36,7 @@ START_TEST(QueryPoints) MOUNTMGR_MOUNT_POINTS MountPoints; PMOUNTMGR_MOUNT_POINTS AllocatedPoints; - MountMgrHandle = GetMountMgrHandle(); + MountMgrHandle = GetMountMgrHandle(FILE_READ_ATTRIBUTES); if (!MountMgrHandle) { win_skip("MountMgr unavailable: %lu\n", GetLastError()); diff --git a/modules/rostests/apitests/mountmgr/precomp.h b/modules/rostests/apitests/mountmgr/precomp.h index 8031f379b24..8414c0d9ce1 100644 --- a/modules/rostests/apitests/mountmgr/precomp.h +++ b/modules/rostests/apitests/mountmgr/precomp.h @@ -23,7 +23,8 @@ LPCSTR wine_dbgstr_us(const UNICODE_STRING *us); HANDLE -GetMountMgrHandle(VOID); +GetMountMgrHandle( + _In_ ACCESS_MASK DesiredAccess); VOID DumpBuffer( diff --git a/modules/rostests/apitests/mountmgr/utils.c b/modules/rostests/apitests/mountmgr/utils.c index 7fa0794d2aa..10f4b527f16 100644 --- a/modules/rostests/apitests/mountmgr/utils.c +++ b/modules/rostests/apitests/mountmgr/utils.c @@ -19,7 +19,8 @@ LPCSTR wine_dbgstr_us(const UNICODE_STRING *us) * The handle should be closed with NtClose() once it is no longer in use. **/ HANDLE -GetMountMgrHandle(VOID) +GetMountMgrHandle( + _In_ ACCESS_MASK DesiredAccess) { NTSTATUS Status; UNICODE_STRING MountMgrDevice; @@ -34,7 +35,7 @@ GetMountMgrHandle(VOID) NULL, NULL); Status = NtOpenFile(&MountMgrHandle, - FILE_READ_ATTRIBUTES | SYNCHRONIZE, + DesiredAccess | SYNCHRONIZE, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE,