Post · 2 min read· pp. 764–765

SYSTEM_FILECACHE_INFORMATION

The SYSTEM_FILECACHE_INFORMATION structure is produced as output by the functions ZwQuerySystemInformation or NtQuerySystemInformation when given any of the information classes

  • SystemFileCacheInformation (0x15);
  • SystemFileCacheInformationEx (0x51);
  • SystemPagedPoolInformationEx (0x77);
  • SystemSystemPtesInformationEx (0x78).

The first two are also acceptable as input to the functions ZwSetSystemInformation or NtSetSystemInformation.

The information classes select different Working Sets to operate on: the System Cache for the first two, the Paged Pool and the System PTEs for the second two.

Documentation Status

The SYSTEM_FILECACHE_INFORMATION structure is not documented.

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_FILECACHE_INFORMATION is 0x24 or 0x40 bytes in 32-bit and 64-bit Windows, respectively, in version 4.0 and higher. It is originally only 0x0C bytes.

Offset (x86)Offset (x64)DefinitionVersions
0x000x00ULONG_PTR CurrentSize;all
0x040x08ULONG_PTR PeakSize;all
0x080x10ULONG PageFaultCount;all
0x0C0x18ULONG_PTR MinimumWorkingSet;4.0 and higher
0x100x20ULONG_PTR MaximumWorkingSet;4.0 and higher
0x140x28ULONG_PTR CurrentSizeIncludingTransitionInPages;4.0 and higher
0x180x30ULONG_PTR PeakSizeIncludingTransitionInPages;4.0 and higher
0x1C0x38ULONG TransitionRePurposeCount;4.0 and higher
0x200x3CULONG Flags;4.0 and higher

When this structure is used for setting system information, only MinimumWorkingSet, MaximumWorkingSet and Flags matter. The Flags matter only for SystemFileCacheInformationEx. For SystemFileCacheInformation, the Flags are treated as zero. The valid bits in the Flags are defined in WINNT.H and are documented for SetProcessWorkingSetSizeEx:

MaskSymbolic Name
0x00000001QUOTA_LIMITS_HARDWS_MIN_ENABLE
0x00000002QUOTA_LIMITS_HARDWS_MIN_DISABLE
0x00000004QUOTA_LIMITS_HARDWS_MAX_ENABLE
0x00000008QUOTA_LIMITS_HARDWS_MAX_DISABLE