// ndis.h
MINIPORT_CANCEL_SEND MiniportCancelSend;
VOID MiniportCancelSend(
[in] NDIS_HANDLE MiniportAdapterContext,
[in] PVOID CancelId
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
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.
Note You must declare the function by using the MINIPORT_CANCEL_SEND type. For more information, see the following Examples section.
MiniportAdapterContext [in]A handle to a context area that the miniport driver allocated in its MiniportInitializeEx function. The miniport driver uses this context area to maintain state information about an adapter.
CancelId [in]A cancellation identifier. This identifier specifies the NET_BUFFER_LIST structures that are being canceled.
Miniport drivers and intermediate drivers that queue send NET_BUFFER_LIST structures export a MiniportCancelSend function. The MiniportCancelSend function cancels the pending transmission of the specified NET_BUFFER_LIST structures.
When an overlying NDIS driver calls the NdisCancelSendNetBufferLists function, NDIS calls the MiniportCancelSend function of the appropriate lower-level driver on the binding. NDIS makes this call only if the lower-level driver exports a MiniportCancelSend function.
A miniport driver's MiniportCancelSend function performs the following operations:
An intermediate driver's MiniportCancelSend function performs the following operations:
NDIS calls MiniportCancelSend at IRQL <= DISPATCH_LEVEL.
To define a MiniportCancelSend function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of callback function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.
For example, to define a MiniportCancelSend function that is named "MyCancelSend", use the MINIPORT_CANCEL_SEND type as shown in this code example:
MINIPORT_CANCEL_SEND MyCancelSend;
Then, implement your function as follows:
_Use_decl_annotations_
VOID
MyCancelSend(
NDIS_HANDLE MiniportAdapterContext,
PVOID CancelId
)
{...}
The MINIPORT_CANCEL_SEND function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the MINIPORT_CANCEL_SEND function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers.
For information about _Use_decl_annotations_, see Annotating Function Behavior.
NDIS_GET_NET_BUFFER_LIST_CANCEL_ID
NdisMSendNetBufferListsComplete