NdisFreeBuffer

VOID
   NdisFreeBuffer(

       IN PNDIS_BUFFER Buffer
       );

NdisFreeBuffer releases a buffer descriptor obtained in a preceding call to NdisAllocateBuffer or NdisCopyBuffer.

Parameters

Buffer

Points to a buffer descriptor.

Comments

NdisFreeBuffer returns the given buffer descriptor to the free list.

A driver must not call NdisFreePacket with a packet to which buffers are chained, because doing this causes a memory leak. Before it releases such a packet, either the driver should call NdisFreeBuffer as many times as necessary to release all buffer descriptors chained to the packet, or it should call either NdisUnchainBufferAtXxx function as many times as necessary to save the pointers to all chained buffer descriptors.

The driver must release any spin lock it is holding before calling NdisFreeBuffer.

Callers of NdisFreeBuffer run at IRQL <= DISPATCH_LEVEL.

See Also

NdisAllocateBuffer, NdisCopyBuffer, NdisFreePacket, NdisReleaseSpinLock, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront