Previous Next

MmGetSystemAddressForMdlSafe

The MmGetSystemAddressForMdlSafe is a macro that returns a nonpaged system-space virtual address for the buffer described by the MDL.

PVOID 
  MmGetSystemAddressForMdlSafe(
    IN PMDL  Mdl,
    IN MM_PAGE_PRIORITY  Priority
    );

Parameters

Mdl
Pointer to a buffer whose corresponding base virtual address is to be mapped.
Priority
Specifies an MM_PAGE_PRIORITY value which indicates the importance of success under low available PTE conditions. Possible values include LowPagePriority, NormalPagePriority, and HighPagePriority.

Return Value

MmGetSystemAddressForMdlSafe returns the base system-space virtual address that maps the physical pages described by the given MDL. If the pages are not already mapped to system space and the attempt to map them fails, NULL is returned.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h and ntddk.h.

Comments

MmGetSystemAddressForMdlSafe maps the physical pages described by a given MDL into system space, if they are not already mapped to system space.

Drivers of PIO devices call this routine to translate a virtual address range, described by the MDL at Irp->MdlAddress, for a user buffer to a system-space address range.

A caller running at IRQL = DISPATCH_LEVEL must supply an MDL that describes nonpageable memory. In other words, the input MDL must describe an already locked-down user-space buffer returned by MmProbeAndLockPages, a locked-down buffer returned by MmBuildMdlForNonPagedPool, or system-space memory allocated from nonpaged pool, contiguous memory, or noncached memory.

The returned base address has the same offset as the virtual address in the MDL.

Callers of MmGetSystemAddressForMdlSafe must be running at IRQL <= DISPATCH_LEVEL.

Windows 98 does not support MmGetSystemAddressForMdlSafe. Use MmGetSystemAddressForMdl instead.

See Also

MmGetSystemAddressForMdl, MmBuildMdlForNonPagedPool, MmProbeAndLockPages