IoBuildPartialMdl

VOID
IoBuildPartialMdl(

IN PMDL SourceMdl,
IN OUT PMDL TargetMdl,
IN PVOID VirtualAddress,
IN ULONG Length
);

IoBuildPartialMdl maps a portion of a buffer described by another MDL into an MDL.

Parameters

SourceMdl

Points to an MDL describing the original buffer, of which a subrange is to be mapped.

TargetMdl

Points to a caller-allocated MDL. The MDL must be large enough to map the subrange specified by VirtualAddress and Length.

VirtualAddress

Points to the base virtual address for the subrange to be mapped in the TargetMdl.

Length

Specifies the length in bytes to be mapped by the TargetMdl. This value, in combination with VirtualAddress, must specify a buffer that is a proper subrange of the buffer described by SourceMdl. If Length is zero, the subrange to be mapped starts at VirtualAddress and includes the remaining range described by the SourceMdl.

Comments

IoBuildPartialMdl maps a subrange of a buffer currently mapped by SourceMdl. The VirtualAddress and Length parameters describe the subrange to be mapped from the SourceMdl into the TargetMdl.

Drivers that must split large transfer requests can use this routine. The caller must release the partial MDL it allocated when it has transferred all the requested data or completed the IRP with an error status.

Callers of IoBuildPartialMdl must be running at IRQL PASSIVE_LEVEL.

See Also

IoAllocateMdl, IoCallDriver, IoFreeMdl, IoSetCompletionRoutine