mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 10:46:58 +00:00
[MOUNTMGR_APITEST] Add custom DesiredAccess to GetMountMgrHandle()
This will allow any future tests, employing IOCTL_MOUNTMGR_* that require read or write accesses, to also use this helper.
This commit is contained in:
parent
8d91d4c8e1
commit
cf2cbe6ff6
4 changed files with 7 additions and 5 deletions
|
@ -571,7 +571,7 @@ START_TEST(QueryDosVolumePaths)
|
||||||
HANDLE hFindVolume;
|
HANDLE hFindVolume;
|
||||||
WCHAR szVolumeName[MAX_PATH];
|
WCHAR szVolumeName[MAX_PATH];
|
||||||
|
|
||||||
MountMgrHandle = GetMountMgrHandle();
|
MountMgrHandle = GetMountMgrHandle(FILE_READ_ATTRIBUTES);
|
||||||
if (!MountMgrHandle)
|
if (!MountMgrHandle)
|
||||||
{
|
{
|
||||||
win_skip("MountMgr unavailable: %lu\n", GetLastError());
|
win_skip("MountMgr unavailable: %lu\n", GetLastError());
|
||||||
|
|
|
@ -36,7 +36,7 @@ START_TEST(QueryPoints)
|
||||||
MOUNTMGR_MOUNT_POINTS MountPoints;
|
MOUNTMGR_MOUNT_POINTS MountPoints;
|
||||||
PMOUNTMGR_MOUNT_POINTS AllocatedPoints;
|
PMOUNTMGR_MOUNT_POINTS AllocatedPoints;
|
||||||
|
|
||||||
MountMgrHandle = GetMountMgrHandle();
|
MountMgrHandle = GetMountMgrHandle(FILE_READ_ATTRIBUTES);
|
||||||
if (!MountMgrHandle)
|
if (!MountMgrHandle)
|
||||||
{
|
{
|
||||||
win_skip("MountMgr unavailable: %lu\n", GetLastError());
|
win_skip("MountMgr unavailable: %lu\n", GetLastError());
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
LPCSTR wine_dbgstr_us(const UNICODE_STRING *us);
|
LPCSTR wine_dbgstr_us(const UNICODE_STRING *us);
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
GetMountMgrHandle(VOID);
|
GetMountMgrHandle(
|
||||||
|
_In_ ACCESS_MASK DesiredAccess);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DumpBuffer(
|
DumpBuffer(
|
||||||
|
|
|
@ -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.
|
* The handle should be closed with NtClose() once it is no longer in use.
|
||||||
**/
|
**/
|
||||||
HANDLE
|
HANDLE
|
||||||
GetMountMgrHandle(VOID)
|
GetMountMgrHandle(
|
||||||
|
_In_ ACCESS_MASK DesiredAccess)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING MountMgrDevice;
|
UNICODE_STRING MountMgrDevice;
|
||||||
|
@ -34,7 +35,7 @@ GetMountMgrHandle(VOID)
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
Status = NtOpenFile(&MountMgrHandle,
|
Status = NtOpenFile(&MountMgrHandle,
|
||||||
FILE_READ_ATTRIBUTES | SYNCHRONIZE,
|
DesiredAccess | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
|
|
Loading…
Reference in a new issue