Skip to content

Latest commit

 

History

History
285 lines (206 loc) · 10.5 KB

nf-fwpsk-fwpsinjectnetworkreceiveasync0.md

File metadata and controls

285 lines (206 loc) · 10.5 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
NF:fwpsk.FwpsInjectNetworkReceiveAsync0
FwpsInjectNetworkReceiveAsync0 function (fwpsk.h)
The FwpsInjectNetworkReceiveAsync0 function injects packet data into the receive data path.Note  FwpsInjectNetworkReceiveAsync0 is a specific version of FwpsInjectNetworkReceiveAsync.
netvista\fwpsinjectnetworkreceiveasync0.htm
netvista
05/02/2018
FwpsInjectNetworkReceiveAsync0 function
FwpsInjectNetworkReceiveAsync0, FwpsInjectNetworkReceiveAsync0 function [Network Drivers Starting with Windows Vista], fwpsk/FwpsInjectNetworkReceiveAsync0, netvista.fwpsinjectnetworkreceiveasync0, wfp_ref_2_funct_3_fwps_I_fb65a452-e8f0-4160-8366-90a1925644da.xml
fwpsk.h
Fwpsk.h
Universal
Available starting with Windows Vista.
Fwpkclnt.lib
<= DISPATCH_LEVEL
Windows
FwpsInjectNetworkReceiveAsync0
fwpsk/FwpsInjectNetworkReceiveAsync0
APIRef
kbSyntax
LibDef
fwpkclnt.lib
fwpkclnt.dll
FwpsInjectNetworkReceiveAsync0

FwpsInjectNetworkReceiveAsync0 function

-description

The FwpsInjectNetworkReceiveAsync0 function injects packet data into the receive data path.

Note  FwpsInjectNetworkReceiveAsync0 is a specific version of FwpsInjectNetworkReceiveAsync. See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information.
 

-parameters

-param injectionHandle [in]

An injection handle that was previously created by a call to the FwpsInjectionHandleCreate0 function with the flags parameter set to FWPS_INJECTION_TYPE_NETWORK.

-param injectionContext [in, optional]

An optional handle to the injection context. If specified, it can be obtained by calling the FwpsQueryPacketInjectionState0 function when the packet injection state FWPS_PACKET_INJECTION_STATE is FWPS_PACKET_INJECTED_BY_SELF or FWPS_PACKET_PREVIOUSLY_INJECTED_BY_SELF.

-param flags [in]

Reserved. Callout drivers must set this parameter to zero.

-param compartmentId [in]

The identifier of the routing compartment into which the packet data is injected, specified as a COMPARTMENT_ID type. This identifier is provided to a callout through the compartmentId member of the FWPS_INCOMING_METADATA_VALUES0 structure that is passed to the callout driver's classifyFn callout function. If the compartmentId member is available to callouts, FWPS_METADATA_FIELD_COMPARTMENT_ID will be set in the currentMetadataValues member. Otherwise, set this parameter to UNSPECIFIED_COMPARTMENT_ID.

-param interfaceIndex [in]

The index of the interface on which the original packet data was received. A callout driver should use the value of the interface index that is passed as one of the incoming data values to its classifyFn callout function for this parameter if the packet is to be injected into the same interface where the original packet was indicated.

-param subInterfaceIndex [in]

The index of the subinterface on which the original packet data was received. A callout driver should use the value of the subinterface index that is passed as one of the incoming data values to its classifyFn callout function for this parameter if the packet is to be injected into the same subinterface where the original packet was indicated.

-param netBufferList [in, out]

A pointer to a NET_BUFFER_LIST structure that describes the packet data that is being injected. A callout driver allocates a NET_BUFFER_LIST structure to use to inject packet data by calling either the FwpsAllocateCloneNetBufferList0 function or the FwpsAllocateNetBufferAndNetBufferList0 function. The NET_BUFFER_LIST structure must begin with an IP header.

-param completionFn [in]

A pointer to a completionFn callout function provided by the callout driver. The filter engine calls this function after the packet data, described by the netBufferList parameter, has been injected into the network stack.

-param completionContext [in, optional]

A pointer to a callout driver–provided context that is passed to the callout function pointed to by the completionFn parameter. This parameter is optional and can be NULL.

-returns

The FwpsInjectNetworkReceiveAsync0 function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The packet data injection was initiated successfully. The filter engine will call the completion function after the filter engine has completed injecting the packet data into the network stack, or when an error occurred subsequently. In case of an error, the Status member of the completed NET_BUFFER_LIST structure will indicate the reason for failure.
STATUS_FWP_TCPIP_NOT_READY
The TCP/IP network stack is not ready to accept injection of packet data.
STATUS_FWP_INJECT_HANDLE_CLOSING
The injection handle is being closed.
STATUS_FWP_INJECT_HANDLE_STALE
The injection handle was not created with the flags parameter of the FwpsInjectionHandleCreate0 function set to FWPS_INJECTION_TYPE_NETWORK.
Other status codes
An error occurred.

-remarks

A callout driver calls the FwpsInjectNetworkReceiveAsync0 function to inject packet data or a packet fragment into the receive data path. This function can execute asynchronously. Callout drivers normally inject data into the network stack when modifying packet data. For more information about how a callout driver can modify packet data, see Callout Driver Operations.

If the return value is not STATUS_SUCCESS, the completion function will not be called. In this case, the net buffer list pointed to by netBufferList must be freed by a call to FwpsFreeNetBufferList0 or FwpsFreeCloneNetBufferList0.

The injected packet can be indicated to the callout driver again. To prevent infinite looping, the driver should first call the FwpsQueryPacketInjectionState0 function before proceeding with a call to the classifyFn callout function, and the driver should permit packets that have the injection state FWPS_PACKET_INJECTION_STATE set to FWPS_PACKET_INJECTED_BY_SELF or FWPS_PACKET_PREVIOUSLY_INJECTED_BY_SELF to pass through unaltered.

-see-also

FWPS_INCOMING_METADATA_VALUES0

FWPS_PACKET_INJECTION_STATE

FwpsAllocateCloneNetBufferList0 FwpsAllocateNetBufferAndNetBufferList0

FwpsFreeCloneNetBufferList0

FwpsFreeNetBufferList0

FwpsInjectionHandleCreate0

FwpsInjectionHandleDestroy0

FwpsQueryPacketInjectionState0

NET_BUFFER_LIST

classifyFn

completionFn