Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Call the NdisAllocateNetBufferListPool function to allocate a pool of NET_BUFFER_LIST structures.
Syntax
NDIS_EXPORTED_ROUTINE NDIS_HANDLE NdisAllocateNetBufferListPool(
[in, optional] NDIS_HANDLE NdisHandle,
[in] NET_BUFFER_LIST_POOL_PARAMETERS const *Parameters
);
Parameters
[in, optional] NdisHandle
An NDIS handle that was obtained during caller initialization.
[in] Parameters
A pointer to a NET_BUFFER_LIST_POOL_PARAMETERS structure that defines the parameters for the pool.
Return value
NdisAllocateNetBufferListPool returns a handle to the NET_BUFFER_LIST structure pool that NDIS allocates. If the allocation was unsuccessful, this handle is NULL. This handle is a required parameter in subsequent calls to NDIS functions that allocate and free NET_BUFFER_LIST structures from this pool.
Remarks
In most cases, a caller that allocates a NET_BUFFER_LIST structure will allocate and queue at least one NET_BUFFER structure on that NET_BUFFER_LIST structure. It is more efficient to preallocate NET_BUFFER structures when you allocate a pool of NET_BUFFER_LIST structures than allocating NET_BUFFER_LIST structures and NET_BUFFER structures separately.
You can call the NdisAllocateNetBufferListPool function with the fAllocateNetBuffer value set to TRUE when creating a NET_BUFFER_LIST structure pool. In this case, a NET_BUFFER structure is preallocated with each NET_BUFFER_LIST structure that the caller allocates from the pool. You can call the NdisAllocateNetBufferAndNetBufferList function or the NdisAllocateNetBufferList function to allocate NET_BUFFER_LIST structures from such a pool. Call NdisAllocateNetBufferAndNetBufferList only if fAllocateNetBuffer is TRUE and DataSize is zero.
You can also call NdisAllocateNetBufferListPool and set the DataSize member to a nonzero value when creating a NET_BUFFER_LIST structure pool. In this case, a NET_BUFFER structure, MDL, and data are preallocated with each NET_BUFFER_LIST structure that the caller allocates from the pool.
NET_BUFFER structures, MDLs, and data buffers that are allocated with NdisAllocateNetBufferAndNetBufferList or NdisAllocateNetBufferList should not be freed separate from the NET_BUFFER_LIST structure. Such structures are freed with the NET_BUFFER_LIST structure when you call the NdisFreeNetBufferList function.
Call the NdisFreeNetBufferListPool function to free a NET_BUFFER_LIST structure pool.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.0 and later. |
Target Platform | Universal |
Header | ndis/nblapi.h (include ndis.h) |
Library | Ndis.lib |
DLL | Ndis.sys |
IRQL | <= DISPATCH_LEVEL |
DDI compliance rules | Irql_NetBuffer_Function(ndis), NdisAllocateNetBufferListPool(ndis), NdisAllocateNetBufferListPool_InitFail(ndis) |
See also
NET_BUFFER_LIST_POOL_PARAMETERS
NdisAllocateNetBufferAndNetBufferList