NdisAllocateNetBufferMdlAndData function

NDIS drivers call the NdisAllocateNetBufferMdlAndData function to allocate a NET_BUFFER structure along with the associated MDL and data.

Syntax


PNET_BUFFER NdisAllocateNetBufferMdlAndData(
  _In_  NDIS_HANDLE PoolHandle
);

Parameters

PoolHandle [in]

A NET_BUFFER structure pool handle that was previously returned from a call to the NdisAllocateNetBufferPool function.

Return value

NdisAllocateNetBufferMdlAndData returns a pointer to the NET_BUFFER structure that NDIS allocated. If the allocation was unsuccessful, this pointer is NULL.

Remarks

The caller must call the NdisAllocateNetBufferPool function and specify the maximum size of the data buffers. Given this value, NDIS can preallocate buffers for the caller.

This function allocates a NET_BUFFER structure, MDL and data in a single memory buffer. This is useful to achieve high performance when NET_BUFFER structures are frequently allocated and freed. The caller should not call NdisAllocateNetBuffer to allocate NET_BUFFERs out of NET_BUFFER pools which contain data.

NDIS uses the PoolHandle parameter to get a block of memory, and then creates the NET_BUFFER, MDL, and data buffer.

To free the NET_BUFFER and associated information, call the NdisFreeNetBuffer function.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

Irql_NetBuffer_Function

See also

NdisAllocateNetBuffer
NdisFreeNetBuffer
NET_BUFFER

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft