[SETUPLIB] Add UNICODE_STRING versions of the pOpenDevice helpers (#7310)

+ Use a FILE_SHARE_ALL define. Based on a suggestion from Whindmar Saksit.
This commit is contained in:
Hermès Bélusca-Maïto 2024-08-31 20:20:38 +02:00
parent 1d3bce1a59
commit ad5d9aa28a
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 79 additions and 12 deletions

View file

@ -7,8 +7,25 @@
#pragma once
/* Flags combination allowing all the read, write and delete share modes.
* Currently similar to FILE_SHARE_VALID_FLAGS. */
#define FILE_SHARE_ALL \
(FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE)
/* FUNCTIONS *****************************************************************/
NTSTATUS
pOpenDeviceEx_UStr(
_In_ PCUNICODE_STRING DevicePath,
_Out_ PHANDLE DeviceHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ ULONG ShareAccess);
NTSTATUS
pOpenDevice_UStr(
_In_ PCUNICODE_STRING DevicePath,
_Out_ PHANDLE DeviceHandle);
NTSTATUS
pOpenDeviceEx(
_In_ PCWSTR DevicePath,