FILTER_SEND_NET_BUFFER_LISTS_COMPLETE callback function

NDIS calls the FilterSendNetBufferListsComplete function to complete a send request that a filter driver started by calling the NdisFSendNetBufferLists function.

Note  You must declare the function by using the FILTER_SEND_NET_BUFFER_LISTS_COMPLETE type. For more information, see the following Examples section.
 

Syntax


FILTER_SEND_NET_BUFFER_LISTS_COMPLETE FilterSendNetBufferListsComplete;

VOID FilterSendNetBufferListsComplete(
  _In_ NDIS_HANDLE      FilterModuleContext,
  _In_ PNET_BUFFER_LIST NetBufferLists,
  _In_ ULONG            SendCompleteFlags
)
{ ... }

Parameters

FilterModuleContext [in]

A handle to the context area for the filter module. The filter driver created and initialized this context area in the FilterAttach function.

NetBufferLists [in]

A pointer to a linked list of NET_BUFFER_LIST structures that the filter driver passed to NdisFSendNetBufferLists.

SendCompleteFlags [in]

NDIS flags that can be combined with an OR operation. To clear all the flags, set this member to zero. This function supports the following flags:

NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL

Specifies that the current IRQL is DISPATCH_LEVEL. For more information about this flag, see Dispatch IRQL Tracking.

NDIS_SEND_COMPLETE_FLAGS_SWITCH_SINGLE_SOURCE

If this flag is set, all packets in a linked list of NET_BUFFER_LIST structures originated from the same Hyper-V extensible switch source port.

For more information, see Hyper-V Extensible Switch Send and Receive Flags.

Note  If each packet in the linked list of NET_BUFFER_LIST structures uses the same source port, the extension should set the NDIS_SEND_FLAGS_SWITCH_SINGLE_SOURCE flag in the SendFlags parameter of SendNetBufferLists when it sends the request.
 
Note  This flag is available in NDIS 6.30 and later.
 

Return value

None

Remarks

FilterSendNetBufferListsComplete is an optional function. If a filter driver does not filter send requests, it can set the entry point for this function to NULL when it calls the NdisFRegisterFilterDriver function.

The filter driver can call the NdisSetOptionalHandlers function, from the FilterSetModuleOptions function, to specify a FilterSendNetBufferListsComplete function for a filter module.

Note  A filter driver that does not provide a FilterSendNetBufferListsComplete function cannot call the NdisFSendNetBufferLists function.
 

When NDIS calls FilterSendNetBufferListsComplete, the filter driver regains ownership of the NET_BUFFER_LIST structures and associated data.

If an overlying driver initiated the send request, the filter driver should call the NdisFSendNetBufferListsComplete function to complete the send request.

If the filter driver originated the send request, FilterSendNetBufferListsComplete can either release the NET_BUFFER_LIST structures and associated data or prepare them for reuse in a subsequent call to NdisFSendNetBufferLists.

Note  A filter driver should keep track of send requests that it initiates and make sure that it does not call NdisFSendNetBufferListsComplete when NDIS calls FilterSendNetBufferListsComplete for such requests.
 

NDIS calls FilterSendNetBufferListsComplete at IRQL <= DISPATCH_LEVEL.

Examples

To define a FilterSendNetBufferListsComplete function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of 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 FilterSendNetBufferListsComplete function that is named "MySendNetBufferListsComplete", use the FILTER_SEND_NET_BUFFER_LISTS_COMPLETE type as shown in this code example:


FILTER_SEND_NET_BUFFER_LISTS_COMPLETE MySendNetBufferListsComplete;

Then, implement your function as follows:


_Use_decl_annotations_
VOID
 MySendNetBufferListsComplete(
    NDIS_HANDLE  FilterModuleContext,
    PNET_BUFFER_LIST  NetBufferLists,
    ULONG  SendCompleteFlags
    )
  {...}

The FILTER_SEND_NET_BUFFER_LISTS_COMPLETE 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 FILTER_SEND_NET_BUFFER_LISTS_COMPLETE 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.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

FilterAttach
FilterSetModuleOptions
NdisFRegisterFilterDriver
NdisFSendNetBufferLists
NdisFSendNetBufferListsComplete
NdisSetOptionalHandlers
NET_BUFFER
NET_BUFFER_LIST

 

 

Send comments about this topic to Microsoft

Show: