// ntifs.h
NTSTATUS IoCheckFunctionAccess(
ACCESS_MASK GrantedAccess,
UCHAR MajorFunction,
UCHAR MinorFunction,
ULONG IoControlCode,
PVOID Arg1,
PVOID Arg2
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoCheckFunctionAccess routine checks the parameters and access for a function against the current granted access to the file.
GrantedAccessMask value that specifies the access currently granted to the file for the caller.
MajorFunctionMajor function code for the operation being performed.
MinorFunctionMinor function code for the operation being performed.
IoControlCodeI/O function control code for a device or file system I/O code.
Arg1Optional argument that depends on the major function. This parameter points to one of the FILE_INFORMATION_CLASS enum values if MajorFunction indicates a query or set file information function is being performed.
Arg2Optional second argument that depends on the major function. This parameter points to one of the FS_INFORMATION_CLASS enum values. This parameter must be supplied if MajorFunction indicates a query or set file information function is being performed.
IoCheckFunctionAccess returns STATUS_SUCCESS if the caller has access to the file; otherwise, it returns STATUS_ACCESS_DENIED.
The GrantedAccess mask cannot contain any generic mappings. That is, IoCheckDesiredAccess must have been previously invoked to return a full mask.