MmGetMdlVirtualAddress

PVOID
    MmGetMdlVirtualAddress(

        IN PMDL  Mdl
        );

MmGetMdlVirtualAddress returns the initial virtual address for a buffer described by a given MDL. The returned address, used as an index to a physical address entry in the MDL, can be input to IoMapTransfer.

Parameters

Mdl
Points to an MDL for a buffer whose initial virtual address is to be returned.

Return Value

MmGetMdlVirtualAddress returns the virtual address that corresponds to the buffer specified by the MDL.

Comments

MmGetMdlVirtualAddress returns a virtual address that is not necessarily valid in the current thread context. Lower-level drivers should not attempt to use the returned virtual address to access memory, particularly user-space memory.

Callers of MmGetMdlVirtualAddress can be running at any IRQL. Usually, the caller is running at IRQL DISPATCH_LEVEL because this routine is commonly called to obtain the CurrentVa parameter to IoMapTransfer.

See Also

IoMapTransfer, MmGetMdlByteOffset, MmIsAddressValid, MmIsNonPagedSystemAddressValid