NET_BUFFER_ALLOCATE_MDL callback function (nblapi.h)

The NetAllocateMdl function allocates an MDL with an associated memory block of a specified size.

Syntax

NET_BUFFER_ALLOCATE_MDL NetBufferAllocateMdl;

MDL * NetBufferAllocateMdl(
  [in] ULONG *BufferSize
)
{...}

Parameters

[in] BufferSize

The size of the memory block, in bytes. When calling NetAllocateMdl, NDIS passes in the requested size.

Return value

NetAllocateMdl returns a pointer to the allocated MDL. If the allocation fails, the return value is NULL.

Remarks

If the NDIS driver specifies an entry point for the NetAllocateMdl function at the AllocateMdl parameter of the NdisRetreatNetBufferDataStart function, NDIS calls NetAllocateMdl to allocate an MDL and memory.

NDIS specifies the size of the associated memory block at BufferSize .

NetAllocateMdl can use any allocation method that meets the driver's design requirements. When NDIS calls the NetFreeMdl function to free the memory, the NDIS driver should free the memory by using the same memory management mechanism that it used to allocate the memory.

NDIS calls NetAllocateMdl at IRQL <= DISPATCH_LEVEL.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Header nblapi.h (include ndis.h)
IRQL <= DISPATCH_LEVEL

See also

NdisRetreatNetBufferDataStart

NetFreeMdl