Canceling a Send Request in a Miniport Driver

The following figure illustrates a miniport driver cancel send operation.

Diagram illustrating a miniport driver cancel send operation.

Protocol, filter, and intermediate drivers can call NdisCancelSendNetBufferLists to cancel outstanding send requests. These overlying drivers must mark the send data with a cancellation ID before making a send request.

NDIS calls a miniport driver's MiniportCancelSend function to cancel the transmission of all NET_BUFFER_LIST structures that are marked with a specified cancellation identifier.

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

  1. Traverses its list of outstanding send requests for the specified adapter and calls NDIS_GET_NET_BUFFER_LIST_CANCEL_ID to obtain the cancellation identifier for each NET_BUFFER_LIST structure. The miniport driver compares the cancellation ID that NDIS_GET_NET_BUFFER_LIST_CANCEL_ID returns with the cancellation ID that NDIS passed to MiniportCancelSend.

  2. Removes from all NET_BUFFER_LIST structures whose cancellation identifiers match the specified cancellation identifier from its list of outstanding send requests.

  3. Calls the NdisMSendNetBufferListsComplete function for all canceled NET_BUFFER_LIST structures to return the structures.The miniport driver sets the status field of the NET_BUFFER_LIST structures to NDIS_STATUS_SEND_ABORTED.