The FwpsInjectNetworkSendAsync0 function injects packet data into the send data path.
NTSTATUS FwpsInjectNetworkSendAsync0( HANDLE injectionHandle, HANDLE injectionContext, UINT32 flags, COMPARTMENT_ID compartmentId, NET_BUFFER_LIST *netBufferList, FWPS_INJECT_COMPLETE0 completionFn, HANDLE completionContext );
An injection handle that was previously created by a call to the FwpsInjectionHandleCreate0 function with the flags parameter set to FWPS_INJECTION_TYPE_NETWORK.
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.
Reserved. Callout drivers must set this parameter to zero.
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.
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.
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.
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.
The FwpsInjectNetworkSendAsync0 function returns one of the following NTSTATUS codes.
||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.|
||The TCP/IP network stack is not ready to accept injection of packet data.|
||The injection handle is being closed.|
||The injection handle was not created with the Flags parameter of the FwpsInjectionHandleCreate0 function set to FWPS_INJECTION_TYPE_NETWORK.|
||An error occurred.|
A callout driver calls the FwpsInjectNetworkSendAsync0 function to inject network packet data into the send 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 needs to be freed by a call to the FwpsFreeNetBufferList0 or FwpsFreeCloneNetBufferList0 functions.
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.
|Minimum supported client||Available starting with Windows Vista.|
|Header||fwpsk.h (include Fwpsk.h)|
See AlsoFWPS_INCOMING_METADATA_VALUES0 FwpsAllocateCloneNetBufferList0 FwpsAllocateNetBufferAndNetBufferList0 FwpsQueryPacketInjectionState0