MmCreateMdl

PMDL
MmCreateMdl(

IN PMDL MemoryDescriptorList,/* optional */
IN PVOID Base,
IN ULONG Length
);

MmCreateMdl allocates and initializes an MDL.

Parameters

MemoryDescriptorList

Points to an MDL to initialize. If this pointer is NULL, an MDL is allocated from nonpaged pool and initialized. Otherwise, the caller-supplied MDL is initialized.

Base

Points to the base virtual address for the buffer.

Length

Specifies the size in bytes of the buffer.

Return Value

MmCreateMdl returns a pointer to the initialized MDL.

Comments

The caller must be running at IRQL < DISPATCH_LEVEL, if the caller passes a NULL pointer for MemoryDescriptorList and expects MmCreateMdl to allocate the storage.

If the call to MmCreateMdl occurs while running at IRQL >= DISPATCH_LEVEL, the caller must allocate memory for the MDL from nonpaged pool and must supply a nonNULL pointer for MemoryDescriptorList.

See Also

MmSizeOfMdl