MmMapMdl function

This function maps physical pages described by a memory descriptor list (MDL) into the system virtual address space.

Syntax

NTSTATUS MmMapMdl(
  PMDL            MemoryDescriptorList,
  ULONG           Protection,
  PMM_MDL_ROUTINE DriverRoutine,
  PVOID           DriverContext
);

Parameters

MemoryDescriptorList

A pointer to a valid MDL.

Protection

A bitwise of flags that indicates the protection to set for the pages. Possible values are PAGE_Xxx constants defined in Wdm.h.

DriverRoutine

A pointer to a driver-supplied callback routine (MM_MDL_ROUTINE) that is invoked after the MDL is mapped.

DriverContext

A pointer to a driver-defined context. The driver's callback function can store any status information in the driver context and then examine the value, when the callback is invoked.

Return Value

If the callback function pointed to by DriverRoutine was invoked, this function returns STATUS_SUCCESS. The function returns an appropriate NTSTATUS value if the MDL could not be mapped or the callback function could not be invoked.

Requirements

   
Minimum supported client Windows 10, version 1709
Minimum supported server Windows Server 2016
Target Platform Windows
Header wdm.h
Library NtosKrnl.lib
DLL NtosKrnl.exe (kernel mode)
IRQL "<=DISPATCH_LEVEL"

See Also

MM_MDL_ROUTINE