Skip to content

Latest commit

 

History

History
207 lines (137 loc) · 9.27 KB

nc-ndis-filter_return_net_buffer_lists.md

File metadata and controls

207 lines (137 loc) · 9.27 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NC:ndis.FILTER_RETURN_NET_BUFFER_LISTS
FILTER_RETURN_NET_BUFFER_LISTS (ndis.h)
NDIS calls the FilterReturnNetBufferLists function to return a linked list of NET_BUFFER_LIST structures and associated data to a filter driver.Note  You must declare the function by using the FILTER_RETURN_NET_BUFFER_LISTS type.
netvista\filterreturnnetbufferlists.htm
netvista
05/02/2018
FILTER_RETURN_NET_BUFFER_LISTS callback function
FILTER_RETURN_NET_BUFFER_LISTS, FILTER_RETURN_NET_BUFFER_LISTS callback, FilterReturnNetBufferLists, FilterReturnNetBufferLists callback function [Network Drivers Starting with Windows Vista], filter_functions_ref_a4a0c4ae-790b-43f9-a209-06538a7bbab6.xml, ndis/FilterReturnNetBufferLists, netvista.filterreturnnetbufferlists
ndis.h
Ndis.h
Windows
Supported in NDIS 6.0 and later.
<= DISPATCH_LEVEL
Windows
FILTER_RETURN_NET_BUFFER_LISTS
ndis/FILTER_RETURN_NET_BUFFER_LISTS
APIRef
kbSyntax
UserDefined
Ndis.h
FILTER_RETURN_NET_BUFFER_LISTS

FILTER_RETURN_NET_BUFFER_LISTS callback function

-description

NDIS calls the FilterReturnNetBufferLists function to return a linked list of NET_BUFFER_LIST structures and associated data to a filter driver.

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

-parameters

-param 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.

-param NetBufferLists [in]

A linked list of NET_BUFFER_LIST structures that the filter driver indicated by calling the NdisFIndicateReceiveNetBufferLists function. The list can include NET_BUFFER_LIST structures from multiple calls to NdisFIndicateReceiveNetBufferLists.

-param ReturnFlags [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_RETURN_FLAGS_DISPATCH_LEVEL

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

NDIS_RETURN_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_RECEIVE_FLAGS_SWITCH_SINGLE_SOURCE flag in the ReceiveFlags parameter of FilterReceiveNetBufferLists when it sends the request.
 

-remarks

FilterReturnNetBufferLists is an optional function. If a filter driver does not filter receive indications, 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 FilterReturnNetBufferLists function for a filter module.

Note  A filter driver that does not provide a FilterReturnNetBufferLists function cannot call the NdisFIndicateReceiveNetBufferLists function to initiate a receive indication.
 
Note  A filter driver that does provide a FilterReturnNetBufferLists function must provide a FilterStatus function.
 
When NDIS calls FilterReturnNetBufferLists, the filter driver regains ownership of the NET_BUFFER_LIST structures and associated data.

If an underlying driver initiated the receive indication, the filter driver should call the NdisFReturnNetBufferLists function to complete the receive indication.

If the filter driver originated the receive indication, FilterReturnNetBufferLists can either release the NET_BUFFER_LIST structures and associated data or prepare them for reuse in a subsequent call to NdisFIndicateReceiveNetBufferLists.

A filter driver should keep track of receive indications that it initiates and make sure that it does not call NdisFReturnNetBufferLists when NDIS calls FilterReturnNetBufferLists.

NDIS calls FilterReturnNetBufferLists at IRQL <= DISPATCH_LEVEL.

Examples

To define a FilterReturnNetBufferLists 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 FilterReturnNetBufferLists function that is named "MyReturnNetBufferLists", use the FILTER_RETURN_NET_BUFFER_LISTS type as shown in this code example:

FILTER_RETURN_NET_BUFFER_LISTS MyReturnNetBufferLists;

Then, implement your function as follows:

_Use_decl_annotations_
VOID
 MyReturnNetBufferLists(
    NDIS_HANDLE  FilterModuleContext,
    PNET_BUFFER_LIST  NetBufferLists,
    ULONG  ReturnFlags
    )
  {...}

The FILTER_RETURN_NET_BUFFER_LISTS 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_RETURN_NET_BUFFER_LISTS 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.

-see-also

FilterAttach

FilterSetModuleOptions

FilterStatus

NET_BUFFER

NET_BUFFER_LIST

NdisFIndicateReceiveNetBufferLists

NdisFRegisterFilterDriver

NdisFReturnNetBufferLists

NdisSetOptionalHandlers