VOID
NdisAllocatePacket(
OUT PNDIS_STATUS Status,
OUT PNDIS_PACKET *Packet,
IN NDIS_HANDLE PoolHandle
);
NdisAllocatePacket allocates and initializes a packet descriptor.
NDIS drivers must allocate packet descriptors from packet pool. Protocol drivers call NdisAllocatePacket one or more times for their subsequent calls to NdisSend or NdisSendPackets. Miniports call NdisAllocatePacket one or more times for subsequent calls to NdisMIndicateReceivePacket. NDIS intermediate drivers must call NdisAllocatePacket to repackage sends and receive indications in fresh packet descriptors before passing incoming transfer requests on to other NDIS drivers.
Each packet descriptor will eventually have one or more buffer descriptors chained to it. NdisAllocatePacket zero-initializes the packet descriptor and sets its buffer chain pointer to NULL. The caller must chain the buffer descriptor(s) mapping the packet data to the packet descriptor before it is sent or indicated. Most NDIS drivers allocate buffer descriptors with NdisAllocateBuffer.
Drivers must use the NDIS_GET/SET_PACKET_XXX macros or NDIS_OOB_DATA_FROM_PACKET to access or set up any out-of-band information associated with the packet descriptor.
Callers of NdisAllocatePacket run at IRQL <= DISPATCH_LEVEL.
NdisAllocateBuffer, NdisAllocatePacketPool, NdisDprAllocatePacket, NdisDprFreePacket, NdisFreePacket, NDIS_GET_PACKET_HEADER_SIZE, NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO, NDIS_GET_PACKET_STATUS, NDIS_GET_PACKET_TIME_RECEIVED, NDIS_GET_PACKET_TIME_SENT, NDIS_GET_PACKET_TIME_TO_SEND, NdisMArcIndicateReceive, NdisMEthIndicateReceive, NdisMFddiIndicateReceive, NdisMIndicateReceivePacket, NdisMTrIndicateReceive, NDIS_OOB_DATA_FROM_PACKET, NDIS_PACKET, NDIS_PACKET_OOB_DATA, NdisSend, NdisSendPackets, NDIS_SET_PACKET_HEADER_SIZE, NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO, NDIS_SET_PACKET_STATUS, NDIS_SET_PACKET_TIME_RECEIVED, NDIS_SET_PACKET_TIME_SENT, NDIS_SET_PACKET_TIME_TO_SEND