Compartilhar via


MiniportCancelSendPackets (Compact 2013)

3/26/2014

This optional function cancels the transmission on a specified adapter of all packets that are marked with a specified cancellation identifier.

Syntax

VOID MiniportCancelSendPackets(
  NDIS_HANDLE MiniportAdapterContext,
  ULONG_PTR CancelId
);

Parameters

  • MiniportAdapterContext
    [in] Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains per-network adapter state, set up by MiniportInitialize.
  • CancelId
    [in] A cancellation identifier. This identifier specifies the packet or group of packets whose transmission is being canceled.

Return Value

None.

Remarks

Miniport drivers and intermediate drivers that queue send packets for more than one second should export a MiniportCancelSendPackets function. The MiniportCancelSendPackets function allows the miniport driver or intermediate driver to cancel the pending transmission of specified send packets.

When a protocol driver or intermediate driver calls the NdisCancelSendPackets function, NDIS calls the MiniportCancelSendPackets function of the appropriate lower-level driver (miniport driver or intermediate driver) on the binding, if the lower-lever driver exports a MiniportCancelSendPackets function.

A miniport driver's MiniportCancelSendPackets function performs the following operations:

  1. Traverses its list of queued packets for the specified adapter and calls NdisGetPacketCancelId to obtain the cancellation identifier for each queued packet. The miniport driver compares the cancellation ID returned by NdisGetPacketCancelId with the cancellation ID supplied to MiniportCancelSendPackets.
  2. Unlinks all packets whose cancellation identifiers match the specified cancellation identifier.
  3. Calls the NdisMSendComplete or NdisMWanSendComplete function for all unlinked packets to return the packet with a completion status of NDIS_STATUS_REQUEST_ABORTED.

An intermediate driver's MiniportCancelSendPackets function performs the following operations:

  1. Performs the operations listed above for a miniport driver's MiniportCancelSendPackets function.
  2. Calls the NdisCancelSendPackets function, specifying the binding that maps to the adapter specified in the call to MiniportCancelSendPackets. In the call to NdisCancelSendPackets, the intermediate miniport driver passes the appropriate NdisBindingHandle and cancellation identifier (CancelId) passed to its MiniportCancelSendPackets function.

An intermediate driver performs these operations regardless of whether it supports packet stacking.

Requirements

Header

externs.h

See Also

Reference

NDIS 5.x Legacy Functions
NdisCancelSendPackets
NdisGetPacketCancelId
NdisGeneratePartialCancelId
NdisMSendComplete
NdisMWanSendComplete
NDIS 5.x Legacy Reference