MmGetPhysicalMemoryRangesEx2 function (ntddk.h)

The MmGetPhysicalMemoryRangesEx2 routine returns the virtual address of a nonpaged pool block which contains the physical memory ranges in the system.

Syntax

PPHYSICAL_MEMORY_RANGE MmGetPhysicalMemoryRangesEx2(
  PVOID PartitionObject,
  ULONG Flags
);

Parameters

PartitionObject

Optional pointer to the partition object to query.

Flags

Whether the caller is interested in FileOnly ranges, and whether to include all partitions.

Return value

NULL on failure.

Remarks

The returned block contains physical address and page count pairs. The last entry contains zero for both.

The caller must understand that although the returned block cannot change after it is returned, the actual memory configuration can change (due to hot-add/remove) at any time.

It is the caller's responsibility to free this block.

Requirements

Requirement Value
Minimum supported client Windows 10, version 2004
Header ntddk.h
IRQL PASSIVE_LEVEL