PVOID
MmMapLockedPages(
IN PMDL MemoryDescriptorList,
IN KPROCESSOR_MODE AccessMode
);
MmMapLockedPages maps physical pages described by a given MDL.
MmMapLockedPages returns the base virtual address that maps the locked pages for the range described by the MDL.
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.
MmGetSystemAddressForMdl, MmProbeAndLockPages, MmUnmapLockedPages