NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO 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_SET_PACKET_MEDIA_SPECIFIC_INFO sets the MediaSpecificInformation pointer and the SizeMediaSpecificInfo value in the out-of-band data block associated with a given packet descriptor.
Syntax
VOID NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
_In_ PNDIS_PACKET Packet,
_In_ PVOID MediaSpecificInfo,
_In_ UINT SizeMediaSpecificInfo
);
Parameters
Packet [in]
Pointer to a driver-allocated packet descriptor.MediaSpecificInfo [in]
Specifies a pointer to a caller-supplied buffer containing medium-specific information, such as packet priority, to be set in the MediaSpecificInformation member of the NDIS_PACKET_OOB_DATA block associated with the given packet descriptor. This parameter cannot be NULL.SizeMediaSpecificInfo [in]
Specifies the number of bytes of information supplied at MediaSpecificInformation. This parameter cannot be zero.
Return value
None
Remarks
Depending on the medium, an underlying driver 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. When a bound protocol is called with the indication, it would use NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO to access the supplied information.
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. The underlying driver would use NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO to access the supplied information.
In either case, while a higher-level protocol is consuming a receive indication or a lower-level miniport driver is processing a send, that driver must have exclusive access to the buffer at MediaSpecificInformation. This restriction implies the following:
A miniport driver cannot access the buffer it set up with out-of-band information when NdisMIndicateReceivePacket returns control if NDIS_STATUS_PENDING is set in the Status member of the associated out-of-band block. The driver can use NDIS_GET_PACKET_STATUS to determine whether each packet in the packet array it just indicated has this status set or has been returned with NDIS_STATUS_SUCCESS.
A protocol driver cannot access the buffer it set up with out-of-band information for a send, nor anything else in the out-of-band data block associated with a packet descriptor it passes to NdisSendPackets or NdisSend, until the packet descriptor is returned to its ProtocolSendComplete function.
Because NDIS queues send packets and resubmits them if the MiniportSend function returns NDIS_STATUS_RESOURCES or if the MiniportSendPackets function sets NDIS_STATUS_RESOURCES for the Status of a packet in a submitted array, the final status of each packet in a send (array) is volatile until that packet has been returned to ProtocolSendComplete.
A protocol driver can call NdisGetReceivedPacket and NDIS_GET_ORIGINAL_PACKET to obtain a copy of the NDIS_PACKET_OOB_DATA block associated with a packet descriptor when its ProtocolReceive function is given an indication. However, these calls are superfluous if the protocol is bound to an underlying driver that does not supply out-of-band information with its indications.
Requirements
Target platform |
Desktop |
Header |
Ndis.h (include Ndis.h) |
IRQL |
<= DISPATCH_LEVEL |
See also
NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO