次の方法で共有


Allocating Network Data Pools in an NDIS 6.0 Miniport Driver

Before sending and receiving NET_BUFFER and NET_BUFFER_LIST structures, the miniport driver must allocate a NET_BUFFER pool and a NET_BUFFER_LIST pool. NDIS 6.0 drivers do not allocate packet pools with the NdisAllocatePacketPool function. To allocate a pool, NDIS 6.0 miniport drivers call the NdisAllocateNetBufferListPool and NdisAllocateNetBufferPool functions.

Each NET_BUFFER_LIST structure that the driver uses to indicate received network data has at least one associated NET_BUFFER structure. A driver that indicates received data should therefore allocate a NET_BUFFER_LIST pool with a pre-allocated NET_BUFFER in each NET_BUFFER_LIST. To create such a pool, call the NdisAllocateNetBufferListPool function with the fAllocateNetBuffer member of the NET_BUFFER_LIST_POOL_PARAMETERS structure set to TRUE.

The miniport driver's MiniportHaltEx function should call the NdisFreeNetBufferListPool and NdisFreeNetBufferPool functions to free the NET_BUFFER_LIST and NET_BUFFER pools, respectively. These functions replace the NdisFreePacketPool function. The driver passes these functions the pool handle that the associated allocation functions returned.

For more information about NDIS 6.0 data buffer management, see Miniport Driver Buffer Management.