MmGetMdlPfnArray - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

PPFN_NUMBER MmGetMdlPfnArray(
  _In_ PMDL Mdl
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-mmgetmdlpfnarray)

Description

The MmGetMdlPfnArray macro returns a pointer to the beginning of the array of physical page numbers that are associated with a memory descriptor list (MDL).

Parameters

Mdl

A pointer to an MDL.

Return value

MmGetMdlPfnArray returns a pointer to the beginning of the array of physical page numbers that are associated with the MDL.

Remarks

MmGetMdlPfnArray returns a pointer to the beginning of the array of physical page numbers that are associated with the MDL.

Macro definition:

#define MmGetMdlPfnArray(Mdl) ((PPFN_NUMBER)(Mdl + 1))

The number of entries in the array is ADDRESS_AND_SIZE_TO_SPAN_PAGES(MmGetMdlVirtualAddress(Mdl), MmGetMdlByteCount(Mdl)).

Each array element is an integer value of type PFN_NUMBER, which is defined in the Wdm.h header file as follows:

typedef ULONG PFN_NUMBER, *PPFN_NUMBER;

Changing the contents of the array can cause subtle system problems that are difficult to diagnose. We recommend that you do not read or change the contents of this array.

For pageable memory, the contents of the array are valid only for a buffer locked with MmProbeAndLockPages.

For nonpaged pool, the contents of the array are valid only for an MDL updated with MmBuildMdlForNonPagedPool, MmAllocatePagesForMdlEx, or MmAllocatePagesForMdl.

For more information about MDLs, see Using MDLs.

Syntax

PPFN_NUMBER MmGetMdlPfnArray(
  _In_ PMDL Mdl
);