// ntifs.h
NTSTATUS IoCheckDesiredAccess(
PACCESS_MASK DesiredAccess,
ACCESS_MASK GrantedAccess
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoCheckDesiredAccess routine determines whether the requested access rights to a file can be granted.
DesiredAccessPointer to a variable containing a mask that identifies the requested access to the file.
GrantedAccessMask value that specifies the access currently granted to the file.
IoCheckDesiredAccess returns STATUS_SUCCESS if DesiredAccess is allowed given the current GrantedAccess; otherwise, it returns STATUS_ACCESS_DENIED.