NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO

VOID
    NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
        IN PNDIS_PACKET  Packet,
        IN PPVOID  pMediaSpecificInfo,
        IN PUINT  pSizeMediaSpecificInfo
        );

NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO returns the MediaSpecificInformation pointer and the SizeMediaSpecificInfo value from the out-of-band data block associated with a given packet descriptor.

Parameters

Packet
Points to a packet descriptor.
pMediaSpecificInfo
Points to a caller supplied variable that this macro sets to the MediaSpecificInformation pointer. The returned address gives the caller access to any buffered out-of-band information, such as packet priority, associated with the specified net packet indicated or to be transmitted.
pSizeMediaSpecificInfo
Points to a caller-supplied variable that this macro sets to the SizeMediaSpecificInfo value, which specifies the size in bytes of the buffer at MediaSpecificInformation.

Comments

NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO returns a NULL pointer at pMediaSpecificInfo and zero at pSizeMediaSpecificInfo if there is no media-specific information in the NDIS_PACKET_OOB_DATA block associated with the given packet descriptor.

Depending on the medium, a NIC miniport might set these members with NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO in the out-of-band data blocks associated with the packet descriptors it allocates for receive indications.

Depending on the medium of the underlying driver to which it is bound, a protocol might set MediaSpecificInformation and SizeMediaSpecificInfo in the out-of-band blocks associated with the packet descriptors it allocates for sends.

In either case, while a higher-level protocol is consuming a receive indication or a lower-level miniport is processing a send, that driver must have exclusive access to the buffer at MediaSpecificInformation. This restriction implies the following:

A protocol driver can call NdisQueryReceiveInformation to obtain this information from the NDIS_PACKET_OOB_DATA block associated with a packet descriptor when its ProtocolReceive function is given an indication. However, this call is superfluous if the protocol is bound to an underlying driver that does not supply out-of-band information with its indications.

Callers of NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO run at IRQL <= DISPATCH_LEVEL.

See Also

MiniportHandleInterrupt, MiniportSend, MiniportSendPackets, MiniportTimer, NdisAllocatePacket, NdisMIndicateReceivePacket, NDIS_OOB_DATA_FROM_PACKET, NDIS_PACKET_OOB_DATA, NdisQueryReceiveInformation, NdisSend, NdisSendPackets, NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO, ProtocolReceive, ProtocolReceivePacket, ProtocolSendComplete