5.3 Access Masks

Every ACE carries an access mask — a 32-bit integer where each bit represents a specific right. The same 32-bit layout is used in three contexts: the ACE's mask (what the rule grants or denies), the requested access (what the caller asks for), and the granted access (what AccessCheck returns).

5.3.1 Bit layout #

The 32 bits are divided into four regions:

5.3.1.1 Object-specific rights (bits 0–15) #

Defined by the object type. Different object types assign different meanings to these bits. A file uses bits for read, write, append, execute; a registry key uses bits for query value, set value, create subkey; a token uses bits for query, duplicate, impersonate. Each subsystem defines its own mapping.

5.3.1.2 Standard rights (bits 16–20) #

Common to all object types:

BitNameValueMeaning
16DELETE0x00010000Delete the object.
17READ_CONTROL0x00020000Read the object's SD (excluding SACL).
18WRITE_DAC0x00040000Modify the object's DACL.
19WRITE_OWNER0x00080000Change the object's owner.
20SYNCHRONIZE0x00100000Wait on the object.

5.3.1.3 Special rights (bits 24–25) #

BitNameValueMeaning
24ACCESS_SYSTEM_SECURITY0x01000000Read or write the SACL. Requires SeSecurityPrivilege.
25MAXIMUM_ALLOWED0x02000000Not a real right. Request flag that tells AccessCheck to compute and return the maximum set of rights the caller would be granted. MUST NOT appear in an ACE.

5.3.1.4 Generic rights (bits 28–31) #

Abstract rights mapped to object-specific rights before evaluation:

BitNameValue
28GENERIC_ALL0x10000000
29GENERIC_EXECUTE0x20000000
30GENERIC_WRITE0x40000000
31GENERIC_READ0x80000000

5.3.1.5 Reserved bits #

Bits 21–23 and 26–27 are reserved and MUST NOT be used. An access mask setting any of them is rejected: a desired access mask carrying one fails the request, and an ACE mask carrying one makes the containing SD unparseable.

5.3.2 Generic mapping #

Generic rights exist because SDs need to be portable across object types. A central access policy might say "allow GENERIC_READ on all objects" — and GENERIC_READ means different specific bits for files versus registry keys.

Each object type defines a GenericMapping table:

FieldDescription
readSpecific + standard bits that GENERIC_READ maps to.
writeSpecific + standard bits that GENERIC_WRITE maps to.
executeSpecific + standard bits that GENERIC_EXECUTE maps to.
allSpecific + standard bits that GENERIC_ALL maps to.

Generic mapping happens once, at request time. AccessCheck MUST map any generic bits in the desired mask to object-specific bits using the object type's GenericMapping table, then clear the generic bits. The DACL walk operates exclusively on specific and standard bits.

Edit this page