Post · 5 min read· pp. 796–799

SYSTEM_PERFORMANCE_INFORMATION

The SYSTEM_PERFORMANCE_INFORMATION structure is what a successful call to ZwQuerySystemInformation or NtQuerySystemInformation produces in its output buffer when given the information class SystemPerformanceInformation (0x02).

Documentation Status

The SYSTEM_PERFORMANCE_INFORMATION structure is defined in WINTERNL.H from the Software Development Kit (SDK). The definition there has the whole structure as one array of 0x0138 bytes, named Reserved1. Documentation of NtQuerySystemInformation describes the structure as “opaque” and suggests that whatever is produced in it for the SystemPerformanceInformation case “can be used to generate an unpredictable seed for a random number generator.”

Microsoft does publish the practical equivalent of a C-language definition as type information in public symbol files, though not for the kernel, where the structure is prepared, nor even for low-level user-mode DLLs that interpret the structure, but for various higher-level user-mode DLLs such as URLMON.DLL and only then starting with version 6.2.

Two earlier disclosures of type information are known, though not in symbol files but in statically linked libraries: GDISRVL.LIB from the Device Driver Kit (DDK) for Windows NT 3.51; and SHELL32.LIB from the DDK for Windows NT 4.0.

Layout

The SYSTEM_PERFORMANCE_INFORMATION is the same in both 32-bit and 64-bit Windows. The structure exists in three sizes:

  • 0x0138 bytes in versions 3.10 to 6.0;
  • 0x0148 bytes in version 6.1;
  • 0x0158 bytes in version 6.2 and higher.

Except for some reuse of members in the ealiest versions, the structure has changed only by extension. Early forms of the structure are supported in later versions simply by allowing callers to ask just for an old size.

OffsetDefinition or DescriptionVersionsRemarks
0x00LARGE_INTEGER IdleProcessTime;3.10 and higher
0x08LARGE_INTEGER IoReadTransferCount;3.10 and higher
0x10LARGE_INTEGER IoWriteTransferCount;3.10 and higher
0x18LARGE_INTEGER IoOtherTransferCount;3.10 and higher
0x20ULONG IoReadOperationCount;3.10 and higher
0x24ULONG IoWriteOperationCount;3.10 and higher
0x28ULONG IoOtherOperationCount;3.10 and higher
0x2CULONG AvailablePages;3.10 and higher
0x30ULONG CommittedPages;3.10 and higher
0x34ULONG CommitLimit;3.10 and higher
0x38ULONG PeakCommitment;3.10 and higher
0x3CULONG PageFaultCount;3.10 and higher
0x40ULONG CopyOnWriteCount;3.10 and higher
0x44ULONG TransitionCount;3.10 and higher
0x48ULONG CacheTransitionCount;3.10 and higher
0x4CULONG DemandZeroCount;3.10 and higher
0x50ULONG PageReadCount;3.10 and higher
0x54ULONG PageReadIoCount;3.10 and higher
0x58ULONG CacheReadCount;3.10 and higher
0x5CULONG CacheIoCount;3.10 and higher
0x60ULONG DirtyPagesWriteCount;3.10 and higher
0x64ULONG DirtyWriteIoCount;3.10 and higher
0x68ULONG MappedPagesWriteCount;3.10 and higher
0x6CULONG MappedWriteIoCount;3.10 and higher
0x70ULONG PagedPoolPages;3.10 and higher
0x74ULONG NonPagedPoolPages;3.10 and higher
0x78ULONG PagedPoolAllocs;3.10 and higher
0x7CULONG PagedPoolFrees;3.10 and higher
0x80ULONG NonPagedPoolAllocs;3.10 and higher
0x84ULONG NonPagedPoolFrees;3.10 and higher
0x88ULONG FreeSystemPtes;3.10 and higher
0x8Cunaccounted dword3.10 only
ULONG ResidentSystemCodePage;3.50 and higher
0x90unaccounted dword3.10 only
ULONG TotalSystemDriverPages;3.50 and higher
0x94unaccounted dword3.10 only
ULONG TotalSystemCodePages;3.50 and higher
0x98unknown dword3.10 to 3.50
ULONG Spare0Count;3.51 only
ULONG NonPagedPoolLookasideHits;4.0 and higher
0x9Cunknown dword3.10 to 3.50
ULONG Spare1Count;3.51 only
ULONG PagedPoolLookasideHits;4.0 and higher
0xA0unknown dword3.10 to 3.50
ULONG Spare3Count;3.51 to 5.0
ULONG AvailablePagedPoolPages;5.1 and higher
0xA4unknown dword3.10 only
ULONG ResidentSystemCachePage;3.50 and higher
0xA8unknown dword3.10 only
ULONG ResidentPagedPoolPage;3.50 and higher
0xACunknown dword3.10 only
ULONG ResidentSystemDriverPage;3.50 and higher
0xB0ULONG CcFastReadNoWait;3.10 and higher
0xB4ULONG CcFastReadWait;3.10 and higher
0xB8ULONG CcFastReadResourceMiss;3.10 and higher
0xBCULONG CcFastReadNotPossible;3.10 and higher
0xC0ULONG CcFastMdlReadNoWait;3.10 and higher
0xC4ULONG CcFastMdlReadWait;3.10 and higher
0xC8ULONG CcFastMdlReadResourceMiss;3.10 and higher
0xCCULONG CcFastMdlReadNotPossible;3.10 and higher
0xD0ULONG CcMapDataNoWait;3.10 and higher
0xD4ULONG CcMapDataWait;3.10 and higher
0xD8ULONG CcMapDataNoWaitMiss;3.10 and higher
0xDCULONG CcMapDataWaitMiss;3.10 and higher
0xE0ULONG CcPinMappedDataCount;3.10 and higher
0xE4ULONG CcPinReadNoWait;3.10 and higher
0xE8ULONG CcPinReadWait;3.10 and higher
0xECULONG CcPinReadNoWaitMiss;3.10 and higher
0xF0ULONG CcPinReadWaitMiss;3.10 and higher
0xF4ULONG CcCopyReadNoWait;3.10 and higher
0xF8ULONG CcCopyReadWait;3.10 and higher
0xFCULONG CcCopyReadNoWaitMiss;3.10 and higher
0x0100ULONG CcCopyReadWaitMiss;3.10 and higher
0x0104ULONG CcMdlReadNoWait;3.10 and higher
0x0108ULONG CcMdlReadWait;3.10 and higher
0x010CULONG CcMdlReadNoWaitMiss;3.10 and higher
0x0110ULONG CcMdlReadWaitMiss;3.10 and higher
0x0114ULONG CcReadAheadIos;3.10 and higher
0x0118ULONG CcLazyWriteIos;3.10 and higher
0x011CULONG CcLazyWritePages;3.10 and higher
0x0120ULONG CcDataFlushes;3.10 and higher
0x0124ULONG CcDataPages;3.10 and higher
0x0128ULONG ContextSwitches;3.10 and higher
0x012CULONG FirstLevelTbFills;3.10 and higher
0x0130ULONG SecondLevelTbFills;3.10 and higher
0x0134ULONG SystemCalls;3.10 and higherlast member in 3.10 to 6.0
0x0138ULONGLONG CcTotalDirtyPages;6.1 and higher
0x0140ULONGLONG CcDirtyPageThreshold;6.1 and higherlast member in 6.1
0x0148LONGLONG ResidentAvailablePages;6.2 and higher
0x0150ULONGLONG SharedCommittedPages;6.2 and higher

No use is known in version 3.10 of the three members at offsets 0x8C to 0x94. In contrast, at offsets 0x98 to 0xAC version 3.10 keeps four counters that the earliest known type information, for version 3.51, explicitly labels spare and two more that are used differently as early as version 3.50. Microsoft’s names may never be known. What the early versions count at offsets 0x98 to 0xA4 are waits for which the given reason is respectively WrLpcReceive, WrLpcReply, WrQueue or WrSpare0 (which was in those days defined as WrEventPair). Offsets 0xA8 and 0xAC in version 3.50 count times that the high and low events in an event pair get set.

It is not known how the sequence from Spare0Count to Spare3Count ever had a Spare2Count.