NDIS_OOB_DATA_FROM_PACKET

PNDIS_PACKET_OOB_DATA
    NDIS_OOB_DATA_FROM_PACKET(
        IN PNDIS_PACKET  _Packet
        ); 

NDIS_OOB_DATA_FROM_PACKET returns a pointer to the out-of-band data block associated with a given packet descriptor.

Parameters

Packet
Points to a packet descriptor.

Return Value

NDIS_OOB_DATA_FROM_PACKET returns a pointer to the out-of-band data block associated with the given packet descriptor, or it returns NULL if there is no out-of-band information for the packet.

Comments

Lower-level NDIS drivers that supply out-of-band information with the packet descriptors they allocate for indications can use NDIS_OOB_DATA_FROM_PACKET to gain access to the out-of-band block associated with a driver-allocated packet descriptor. Such a driver would then set up out-of-band information before indicating a receive packet.

For example, an NDIS intermediate driver might copy the out-of-band information from a received packet into a fresh packet descriptor with NdisMoveMemory before forwarding the indication up to bound protocols. In these circumstances, the intermediate driver calls NdisMoveMemory with the pointers returned by NDIS_OOB_DATA_FROM_PACKET as the Source and Destination pointers and sizeof(NDIS_PACKET_OOB_DATA) as the Length.

Lower-level NDIS drivers also might use this macro when the Status of an indicated packet is returned from NdisMIndicateReceivePacket with NDIS_STATUS_SUCCESS or when MiniportReturnPacket is called with a packet descriptor to be reinitialized for reuse. In these circumstances, the driver can call NdisZeroMemory with the pointer returned by NDIS_OOB_DATA_FROM_PACKET and sizeof(NDIS_PACKET_OOB_DATA) to clear the out-of-band data block associated with the packet descriptor. Alternatively, such a driver can use the appropriate NDIS_SET_PACKET_XXX macros to reinitialize specific members in the out-of-band data block for subsequent indications with the returned packet descriptor.

Higher-level NDIS drivers can use NDIS_OOB_DATA_FROM_PACKET to reinitialize the out-of-band data block associated with the packet descriptors they allocate to specify sends when such a packet descriptor has been returned to the ProtocolSendComplete function. Consequently, drivers underlying such a protocol might use NDIS_OOB_DATA_FROM_PACKET to read the out-of-band information for an incoming send packet.

A driver should never pass a packet descriptor to NdisZeroMemory in an attempt to clear the out-of-band data block associated with a packet descriptor. Doing this destroys the given packet descriptor, renders it useless for subsequent indications or sends, and causes a memory leak. A driver must pass the pointer returned by NDIS_OOB_DATA_FROM_PACKET to zero-(re)initialize the out-of-band data block associated with a driver-allocated packet descriptor.

See Also

MiniportHandleInterrupt, MiniportReturnPacket, MiniportSend, MiniportSendPackets, MiniportTimer, NdisAllocatePacket, 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, NdisMIndicateReceivePacket, NdisMoveMemory, NDIS_PACKET_OOB_DATA, 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, NdisZeroMemory, ProtocolReceive, ProtocolReceivePacket, ProtocolSendComplete