Bagikan melalui


NDIS_GET_PACKET_STATUS function

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.

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

Syntax

NDIS_STATUS NDIS_GET_PACKET_STATUS(
  _In_ PNDIS_PACKET Packet
);

Parameters

  • Packet [in]
    Pointer 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:

Return code Description
NDIS_STATUS_SUCCESS

If this is set on return from a miniport driver's call to NdisMIndicateReceivePacket, the miniport driver 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 driver just indicated

The miniport 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 driver 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.

NDIS_STATUS_RESOURCES

If this is set, a connection-oriented protocol driver's ProtocolCoReceivePacket function must copy the packet data immediately rather than retaining the NIC-driver-allocated packet resources.

 

Remarks

Serialized drivers (miniport drivers or intermediate drivers) that indicate receives up to higher-level drivers use this macro. Connection-oriented protocols call this macro from ProtocolCoReceivePacket to determine whether they have ownership of an indicated packet's resources or whether they must copy the packet data immediately before the packet is returned to the indicating underlying driver.

Deserialized drivers and connection-oriented drivers do not have to use this macro. When such drivers indicate up a packet whose Status is not set to NDIS_STATUS_RESOURCES, NDIS always returns the packet to the driver's MiniportReturnPacket function. When such drivers indicate up a packet whose Status is set to NDIS_STATUS_RESOURCES, NDIS always returns the packet implicitly on return from NdisMIndicateReceivePacket or NdisMCoIndicateReceivePacket. In short, when NDIS returns a packet to a such driver -- either on the return from NdisMIndicateReceivePacket or NdisMCoIndicateReceivePacket or to the driver's MiniportReturnPacket function -- the returned packet and all its associated resources belong to the driver. The driver should save the Status of each received packet that it indicates up so that it knows, on the return of NdisMIndicateReceivePacket or NdisMCoIndicateReceivePacket whether the packet's Status is NDIS_STATUS_RESOURCES.

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.

Requirements

Target platform

Desktop

Header

Ndis.h (include Ndis.h)

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

ProtocolCoReceivePacket

ProtocolSendComplete

 

 

Send comments about this topic to Microsoft