MmSizeOfMdl

ULONG
    MmSizeOfMdl(

        IN PVOID  Base,
        IN ULONG  Length
        );

MmSizeOfMdl returns the number of bytes to allocate for an MDL describing a given address range.

Parameters

Base
Points to the base virtual address for the range.
Length
Supplies the size, in bytes, of the range.

Return Value

MmSizeOfMdl returns the number of bytes required to contain the MDL.

Comments

The given address range must be locked down if it will be accessed at raised IRQL.

Memory for the MDL itself must be allocated from nonpaged pool if the caller subsequently passes a pointer to the MDL while running at IRQL >= DISPATCH_LEVEL.

Callers of MmSizeOfMdl run at any IRQL.

See Also

MmCreateMdl, MmInitializeMdl