Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisAllocatePacket allocates and initializes a packet descriptor.
VOID NdisAllocatePacket( _Out_ PNDIS_STATUS Status, _Out_ PNDIS_PACKET *Packet, _In_ NDIS_HANDLE PoolHandle );
- Status [out]
Pointer to a caller-supplied variable in which this function returns the final status of the request, which can be one of the following:
The caller can use the packet descriptor returned at Packet. A subsequent call to NdisFreePacket will return the given entry to the free list.
The free list for the packet pool currently has no available entries.
- Packet [out]
Pointer to a caller-supplied variable in which this function returns a pointer to the allocated packet descriptor.
- PoolHandle [in]
Specifies the handle returned by a preceding call to NdisAllocatePacketPool.
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. Miniport drivers 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.
|Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisAllocateNetBuffer instead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.|