PS_QUOTA_TYPE

The PS_QUOTA_TYPE enumeration selects from the various types of resource that are subject to quotas.

The PS_QUOTA_TYPE is here thought to have been introduced with a reorganisation of the EPROCESS_QUOTA_BLOCK for Windows XP. This structure had treated quota properties such as current usage, peak usage and limit as separate members for the two pool types and the page file. For the two pool types, each member was already an array: QuotaPoolUsage, QuotaPeakPoolUsage and QuotaPoolLimit. Each was indexed by the NonPagedPool (0) and PagedPool (1) values from the POOL_TYPE enumeration. The reorganisation gathered the properties for each quota type into an EPROCESS_QUOTA_ENTRY, each with its own Usage, Peak and Limit. The quota block then has an array of these entries as is QuotaEntry member. The PS_QUOTA_TYPE indexes this array.

Documentation Status

Though the PS_QUOTA_TYPE itself is not documented, its existence is hinted at in Microsoft’s documentation of the QUOTA_UNDERFLOW (0x21) bug check, whose second argument is described as “The quota type.” The documentation advises

For the list of all possible quota type values, see the header file Ps.h in the Windows Driver Kit (WDK).

As if to prove that Microsoft writes its Windows documentation first for its own programmers and support staff, and as something of an afterthought for programmers in general, no PS.H is present in any known edition of the WDK or of any earlier Device Driver Kit (DDK).

The “possible quota type values” are disclosed as type information in public symbol files for the kernel in Windows XP and Windows Server 2003. The type then disappears even from the public symbol files (as do the EPROCESS_QUOTA_BLOCK and the EPROCESS_QUOTA_ENTRY).

Values

Names and values are reproduced below from the public symbol files for the kernel in versions 5.1 and 5.2. Microsoft’s names for the types added in version 6.0 may never be known.

Value Name Versions
0 PsNonPagedPool 5.1 and higher
1 PsPagedPool 5.1 and higher
2 PsPageFile 5.1 and higher
3 working set pages 6.0 and higher
4 CPU rate limit 6.0 to 6.2
3 (5.1 to 5.2);
5 (6.0 to 6.2);
4
PsQuotaTypes 5.1 and higher

That the PS_QUOTA_TYPE continues to version 6.0 and beyond seems more than merely plausible, but it may not be the whole story in these versions. Version 6.0 introduces several internal variables that are arrays indexed by the PS_QUOTA_TYPE or by something very like it. These arrays each have five members up to and including version 6.2.