VOID
NdisAllocatePacketPool(
OUT PNDIS_STATUS Status,
OUT PNDIS_HANDLE PoolHandle,
IN UINT NumberOfDescriptors,
IN UINT ProtocolReservedLength
);
NdisAllocatePacketPool allocates and initializes a block of storage for a pool of packet descriptors.
A successful call to NdisAllocatePacketPool returns a handle to the packet pool, which the caller should save. Usually, the driver next calls NdisAllocatePacket one or more times with this handle to allocate a set of packet descriptors. The NumberOfDescriptors specified in the call to NdisAllocatePacketPool is the effective limit on how many times the driver can call NdisAllocatePacket before it must call NdisFreePacket to return a packet descriptor to the free list for the packet pool.
As packets sent or indicated are returned to the allocating driver, it can reuse each packet descriptor after calling NdisReinitializePacket and setting it up again with a chain of buffer descriptors, or the driver can call NdisFreePacket to return that packet to the free list. Reinitializing and reusing packets allocated from packet pool is far faster than freeing and, then, having to reallocate them again. Before a driver calls NdisReinitializePacket with a packet descriptor, it must save the pointers to buffer descriptors that are chained to the packet descriptor since NdisReinitializePacket sets the head of the buffer chain to NULL.
When the driver no longer needs the packet pool, it calls NdisFreePacketPool to release the packet pool storage.
The driver must release any spin lock it is holding before calling NdisAllocatePacketPool.
Callers of NdisAllocatePacketPool run at IRQL <= DISPATCH_LEVEL.
NdisAllocatePacket, NdisDprAllocatePacket, NdisDprAllocatePacketNonInterlocked, NdisFreePacketPool, NdisMIndicateReceivePacket, NDIS_PACKET, NDIS_PACKET_OOB_DATA, NdisReinitializePacket, NdisSendPackets, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront, ProtocolSendComplete