Post · 3 min read· pp. 1919–1921

TYPE_OF_MEMORY

The TYPE_OF_MEMORY enumeration (formally _TYPE_OF_MEMORY) distinguishes different blocks of physical memory that the kernel learns about from the loader and then puts to use, including to break them into smaller blocks or to disregard them. Each memory block is described by a MEMORY_ALLOCATION_DESCRIPTOR. The TYPE_OF_MEMORY is thought to have no lasting meaning except as this descriptor’s member that’s named MemoryType.

Availability

The TYPE_OF_MEMORY is ancient, being already well established for Windows NT 3.1.

Documentation Status

Microsoft is not known ever to have documented the TYPE_OF_MEMORY. For many years, it was known from Microsoft only through type information in public symbol files for the kernel. Even this started only as recently as Windows Vista. After roughly another decade, Microsoft published a C-language definition. This is in a header named ARC.H which Microsoft distributed with the Windows Driver Kit (WDK) for Windows 10 in its original and Version 1511 editions. This disclosure was very likely a mistake. The header is in a subdirectory, named “minwin”, of a directory named “um” as if for user-mode programming even though many of the headers in the subdirectory define types that no user-mode software has any access to. Oversight or not, the header was gone from the WDK for Version 1607.

Values

Where a memory block comes from and what use it has yet been put to has ever more possibilities in ever later versions. Microsoft’s names are known from public symbol files for the kernel, starting with Windows Vista. What’s known for earlier versions comes from inspecting the binaries for continuity with the later versions. Nearly two dozen types look to be ancient: the kernel in version 3.50 (only) has plain-text descriptions which all match the names that are known from later symbol files.

ValueNameVersions
0x00000000LoaderExceptionBlockall
0x00000001LoaderSystemBlockall
0x00000002LoaderFreeall
0x00000003LoaderBadall
0x00000004LoaderLoadedProgramall
0x00000005LoaderFirmwareTemporaryall
0x00000006LoaderFirmwarePermanentall
0x00000007LoaderOsloaderHeapall
0x00000008LoaderOsloaderStackall
0x00000009LoaderSystemCodeall
0x0000000ALoaderHalCodeall
0x0000000BLoaderBootDriverall
0x0000000CLoaderConsoleInDriverall
0x0000000DLoaderConsoleOutDriverall
0x0000000ELoaderStartupDpcStackall
0x0000000FLoaderStartupKernelStackall
0x00000010LoaderStartupPanicStackall
0x00000011LoaderStartupPcrPageall
0x00000012LoaderStartupPdrPageall
0x00000013LoaderRegistryDataall
0x00000014LoaderMemoryDataall
0x00000015LoaderNlsDataall
0x00000016LoaderSpecialMemoryall
0x00000017LoaderBBTMemory5.0 and higher
0x00000018LoaderReserve5.0 to 6.3
LoaderZero10.0 and higher
0x00000019LoaderXIPRom5.1 and higher
0x0000001ALoaderHALCachedMemory5.1 and higher
0x0000001BLoaderLargePageFiller5.1 and higher
0x0000001CLoaderErrorLogMemory6.1 and higher
0x0000001DLoaderVsmMemory10.0 and higher
0x0000001ELoaderFirmwareCode10.0 and higher
0x0000001FLoaderFirmwareData10.0 and higher
0x00000020LoaderFirmwareReserved10.0 and higher
0x00000021LoaderEnclaveMemory1511 and higher
0x00000022LoaderFirmwareKsr1607 and higher
0x00000023LoaderEnclaveKsr1703 and higher
0x00000024LoaderSkMemory1809 and higher
0x00000025LoaderSkFirmwareReserved1903 and higher
0x00000026LoaderIoSpaceMemoryZeroed1903 and higher
0x00000027LoaderIoSpaceMemoryFree1903 and higher
0x00000028LoaderIoSpaceMemoryKsr1903 and higher
0x0000001C (6.0); 0x0000001D (6.1 to 6.3); 0x00000021 (10.0); 0x00000022 (1511); 0x00000023 (1607); 0x00000024 (1703 to 1803); 0x00000025 (1809); 0x00000029LoaderMaximum

While LoaderMaximum looks to be just a programming convenience that leaves no trace in the code, which version first defines it is not known.