Map generic access rights to specific masks
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 34s
Builds / ExectOS (i686, debug) (push) Successful in 33s
Builds / ExectOS (amd64, release) (push) Successful in 43s
Builds / ExectOS (i686, release) (push) Successful in 42s

This commit is contained in:
2026-08-18 20:16:22 +02:00
parent 6448335db1
commit f9008510f5
2 changed files with 52 additions and 0 deletions

View File

@@ -52,3 +52,53 @@ SE::Access::ComputeGrantedAccesses(IN ACCESS_MASK GrantedAccessMask,
/* Return the desired granted accesses */
return GrantedAccessMask & DesiredAccessMask;
}
/**
* Maps all generic accesses in the provided access mask to specific and standard accesses.
*
* @param AccessMask
* Supplies a pointer to the access mask to be mapped.
*
* @param Mapping
* Supplies the mapping of generic to specific and standard access types.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
SE::Access::MapGenericMask(IN OUT PACCESS_MASK AccessMask,
IN PGENERIC_MAPPING Mapping)
{
/* Check if the read right is present in the access mask */
if(*AccessMask & SE_GENERIC_READ)
{
/* Map the read flag to its specific access rights */
*AccessMask |= Mapping->GenericRead;
}
/* Check if the write right is present in the access mask */
if(*AccessMask & SE_GENERIC_WRITE)
{
/* Map the write flag to its specific access rights */
*AccessMask |= Mapping->GenericWrite;
}
/* Check if the execute right is present in the access mask */
if(*AccessMask & SE_GENERIC_EXECUTE)
{
/* Map the execute flag to its specific access rights */
*AccessMask |= Mapping->GenericExecute;
}
/* Check if the all right is present in the access mask */
if(*AccessMask & SE_GENERIC_ALL)
{
/* Map the all flag to its specific access rights */
*AccessMask |= Mapping->GenericAll;
}
/* Clear the generic flags from the final access mask */
*AccessMask &= ~(SE_GENERIC_READ | SE_GENERIC_WRITE | SE_GENERIC_EXECUTE | SE_GENERIC_ALL);
}