Post · 1 min read· pp. 2155–2156

Application Compatibility Flags in the PEB

The PEB got two sets of flags for Application Compatibility in Windows XP, one each apparently for kernel and user issues. The kernel set is named AppCompatFlags and is reliably at offsets 0x01D8 and 0x02C8 in 32-bit and 64-bit Windows, respectively. As a set, these flags are a ULARGE_INTEGER. Individual flags are defined by macros. Microsoft’s names for them therefore do not show in public symbol files and might have been unknown forever except that Microsoft published some in a header named APCOMPAT.H in the Enterprise edition of the Windows Driver Kit (WDK) for the original and 1511 releases of Windows 10.

MaskName
0x00000001KACF_OLDGETSHORTPATHNAME
0x00000002KACF_VERSIONLIE_NOT_USED
0x00000004not defined
0x00000008KACF_GETDISKFREESPACE
0x00000010not defined
0x00000020KACF_FTMFROMCURRENTAPT
0x00000040KACF_DISALLOWORBINDINGCHANGES
0x00000080KACF_OLE32VALIDATEPTRS
0x00000100KACF_DISABLECICERO
0x00000200KACF_OLE32ENABLEASYNCDOCFILE
0x00000400KACF_OLE32ENABLELEGACYEXCEPTIONHANDLING
0x00000800KACF_RPCDISABLENDRCLIENTHARDENING
0x00001000KACF_RPCDISABLENDRMAYBENULL_SIZEIS
0x00002000KACF_DISABLEALLDDEHACK_NOT_USED
0x00004000KACF_RPCDISABLENDR61_RANGE
0x00008000KACF_RPC32ENABLELEGACYEXCEPTIONHANDLING
0x00010000KACF_OLE32DOCFILEUSELEGACYNTFSFLAGS
0x00020000KACF_RPCDISABLENDRCONSTIIDCHECK
0x00040000KACF_USERDISABLEFORWARDERPATCH
0x00080000not defined
0x00100000KACF_OLE32DISABLENEW_WMPAINT_DISPATCH
0x00200000KACF_ADDRESTRICTEDSIDINCOINITIALIZESECURITY
0x00400000KACF_ALLOCDEBUGINFOFORCRITSECTIONS
0x00800000KACF_OLEAUT32ENABLEUNSAFELOADTYPELIBRELATIVE
0x01000000KACF_ALLOWMAXIMIZEDWINDOWGAMMA
0x80000000KACF_DONOTADDTOCACHE

That the AppCompatFlags represent kernel compatibility issues, as distinct from the issues that have the separate AppCompatFlagsUser member, looks to be entirely a user-mode distinction, as originally modelled by the separation of KERNEL32 and USER32. APPHELP loads them from the MASK attribute of a tag whose TYPE is KERNEL.