NdisAllocatePacket (Windows CE 5.0)

Send Feedback

This function allocates and initializes a packet descriptor.

VOID NdisAllocatePacket(PNDIS_STATUSStatus,PNDIS_PACKET* Packet,NDIS_HANDLEPoolHandle);

Parameters

  • Status
    [out] Pointer to a caller-supplied variable in which this function returns the final status of the request.
  • Packet
    [out] Pointer to a caller-supplied variable in which this function returns a pointer to the allocated packet descriptor.
  • PoolHandle
    [in] Handle returned by a preceding call to the NdisAllocatePacketPool function.

Return Values

The following table shows the return values for NdisAllocatePacket.

Value Description
NDIS_STATUS_SUCCESS The caller can use the packet descriptor returned by the Packet parameter.
NDIS_STATUS_RESOURCES The free list for the packet pool currently has no available entries. A subsequent call to the NdisFreePacket function returns the specified entry to the free list.

Remarks

NDIS drivers must allocate packet descriptors from a packet pool. Protocol drivers call this function one or more times for their subsequent calls to the NdisSend function. Miniports call this function one or more times for subsequent calls to the NdisMIndicateReceivePacket function. NDIS intermediate drivers must call this function to repackage sends and receive indications in fresh packet descriptors before passing incoming transfer requests on to other NDIS drivers.

Each packet descriptor eventually has one or more buffer descriptors chained to it. This function initializes the packet descriptor at 0 and sets its buffer chain pointer to NULL. The caller must chain the buffer descriptors mapping the packet data to the packet descriptor before it is sent or indicated. Most NDIS drivers allocate buffer descriptors with the NdisAllocateBuffer function.

Drivers must use the NDIS_SET_PACKET_XXX macros to access or set up any out-of-band information associated with the packet descriptor.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.lib

See Also

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 | NdisAllocateBuffer | NdisAllocatePacketPool | NdisAllocateMemory | NdisFreePacket | NdisMEthIndicateReceive | NdisMIndicateReceivePacket | NdisSend

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.