ULONG
MmSizeOfMdl(
IN PVOID Base,
IN ULONG Length
);
MmSizeOfMdl returns the number of bytes to allocate for an MDL describing a given address range.
MmSizeOfMdl returns the number of bytes required to contain the MDL.
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.