Share via


NdisAllocateNetBufferList (Compact 7)

3/12/2014

Call this function to allocate and initialize a NET_BUFFER_LIST structure from a NET_BUFFER_LIST structure pool.

Syntax

PNET_BUFFER_LIST
  NdisAllocateNetBufferList(
    IN NDIS_HANDLE  PoolHandle,
    IN USHORT  ContextSize,
    IN USHORT  ContextBackFill
    );

Parameters

  • ContextSize
    The amount of used dataspace in the NET_BUFFER_LIST_CONTEXT structure to reserve for the caller. The ContextSize must be a multiple of the value that is defined by MEMORY_ALLOCATION_ALIGNMENT.
  • ContextBackFill
    The unused dataspace (backfill space) that the caller requires. NDIS adds this value to the ContextSize and allocates additional space. The ContextBackFill must be a multiple of the value that is defined by MEMORY_ALLOCATION_ALIGNMENT.

Return Value

NdisAllocateNetBufferList returns a pointer to the allocated NET_BUFFER_LIST structure. If the allocation was unsuccessful, this pointer is NULL.

Remarks

You can call the NdisAllocateNetBufferList or NdisAllocateNetBufferAndNetBufferList function to allocate a NET_BUFFER_LIST structure from a pool.

If you call NdisAllocateNetBufferList and the NET_BUFFER_LIST structure pool was allocated by calling the NdisAllocateNetBufferListPool function with the fAllocateNetBuffer member of the NET_BUFFER_LIST_POOL_PARAMETERS structure set to TRUE, NDIS allocates a NET_BUFFER_LIST, NET_BUFFER, MDL, and data.

Call the NdisFreeNetBufferList function to free a NET_BUFFER_LIST structure.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NdisAllocateNetBufferAndNetBufferList
NdisAllocateNetBufferListPool
NdisFreeNetBufferList
NET_BUFFER
NET_BUFFER_LIST
NET_BUFFER_LIST_CONTEXT