W_CANCEL_SEND_PACKETS_HANDLER callback 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.

The MiniportCancelSendPackets function is optional. For a specified adapter, MiniportCancelSendPackets cancels the transmission of all packets that are marked with a specified cancellation identifier.

Syntax

W_CANCEL_SEND_PACKETS_HANDLER MiniportCancelSendPackets;

VOID MiniportCancelSendPackets(
  _In_ NDIS_HANDLE MiniportAdapterContext,
  _In_ PVOID       CancelId
)
{ ... }

Parameters

  • MiniportAdapterContext [in]
    Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains per-NIC 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, provided that 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 NDIS_GET_PACKET_CANCEL_ID to obtain the cancellation identifier for each queued packet. The miniport driver compares the cancellation ID returned by NDIS_GET_PACKET_CANCEL_ID with the cancellation ID supplied to MiniportCancelSendPackets.

  2. Unlinks all packets whose cancellation identifiers match the specified cancellation identifier.

  3. Calls the NdisMSendComplete, NdisMWanSendComplete, or NdisMCoSendComplete 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 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.

System support for MiniportCancelSendPackets is available in Windows XP and later operating systems.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use MiniportCancelSend instead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

NdisCancelSendPackets

NDIS_GET_PACKET_CANCEL_ID

NdisGeneratePartialCancelId

NdisMCoSendComplete

NdisMSendComplete

NdisMWanSendComplete

NDIS_SET_PACKET_CANCEL_ID

 

 

Send comments about this topic to Microsoft