NDIS_GET_PACKET_STATUS

NDIS_STATUS
    NDIS_GET_PACKET_STATUS(
        IN PNDIS_PACKET  Packet
        );

NDIS_GET_PACKET_STATUS returns the Status value from the out-of-band data block associated with a given packet descriptor.

Parameters

Packet
Points to a packet descriptor.

Return Value

NDIS_GET_PACKET_STATUS returns the Status value currently set in the NDIS_PACKET_OOB_DATA block associated with the given packet descriptor, usually one of the following:

NDIS_STATUS_SUCCESS
If this is set on return from a miniport’s call to NdisMIndicateReceivePacket, the miniport regains ownership of the following:
  • The packet descriptor

  • The associated out-of-band data block and of any media-specific information buffer specified in this block

  • All buffers mapped by buffer descriptors chained to the packet the miniport just indicated

The driver can prepare these descriptors, the out-of-band block, and media-specific information buffer, if any, for reuse in subsequent receive indications, and, if it is a NIC driver, can receive new data in the NIC’s receive buffers mapped by the returned buffer descriptors.

NDIS_STATUS_PENDING
If this is set on return from NdisMIndicateReceivePacket, protocols retain ownership of the following:
  • The packet descriptor

  • The associated out-of-band data block and of any media-specific information buffer specified in this block

  • All buffers mapped by buffer descriptors chained to the packet the miniport just indicated

Until the packet descriptor is returned to the MiniportReturnPacket function of the indicating driver, it should not access any of the buffers specified with the packet descriptor.

Comments

Only drivers that indicate receives up to higher-level drivers use this macro.

Protocol drivers should never test the Status value in an associated out-of-band data block on return from NdisSendPackets or NdisSend. NDIS or the underlying driver retains ownership of the packet descriptor, of the associated out-of-band block and any buffers specified in this block, and of all buffers mapped by buffer descriptors chained to the packet descriptor until the ProtocolSendComplete function is called with the packet descriptor.

Callers of NDIS_GET_PACKET_STATUS run at IRQL <= DISPATCH_LEVEL.

See Also

MiniportHandleInterrupt, MiniportReturnPacket, MiniportTimer, NdisAllocatePacket, NdisMIndicateReceivePacket, NDIS_OOB_DATA_FROM_PACKET, NDIS_PACKET_OOB_DATA, NdisSend, NdisSendPackets, NDIS_SET_PACKET_STATUS, ProtocolSendComplete