MmMapLockedPages

PVOID
    MmMapLockedPages(

        IN PMDL  MemoryDescriptorList,
        IN KPROCESSOR_MODE  AccessMode
        );

MmMapLockedPages maps physical pages described by a given MDL.

Parameters

MemoryDescriptorList
Points to an MDL that has been updated by MmProbeAndLockPages.
AccessMode
Specifies the access mode in which to map the MDL, either KernelMode or UserMode. Lower-level drivers should use KernelMode.

Return Value

MmMapLockedPages returns the base virtual address that maps the locked pages for the range described by the MDL.

Comments

The MDL in an IRP at Irp->MdlAddress does not necessarily map a buffer for the current thread when that IRP is processed by lower-level drivers. Therefore, the user-mode virtual addresses corresponding to the locked-down physical pages can be invisible or invalid.

Callers of MmMapLockedPages must be running at IRQL <= DISPATCH_LEVEL if AccessMode is KernelMode. Otherwise, the caller must be running at IRQL < DISPATCH_LEVEL.

See Also

MmGetSystemAddressForMdl, MmProbeAndLockPages, MmUnmapLockedPages