FwpsInjectvSwitchEthernetIngressAsync0 function

The FwpsInjectvSwitchEthernetIngressAsync0 (was FwpsInjectvSwitchIngressAsync0) function reinjects a previously absorbed virtual switch packet (unmodified) back to the virtual switch ingress data path where it was intercepted. This function can also inject a packet created with the FwpsAllocateNetBufferAndNetBufferList0 function.

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

Syntax

NTSTATUS FwpsInjectvSwitchEthernetIngressAsync0(
  HANDLE                injectionHandle,
  HANDLE                injectionContext,
  UINT32                flags,
  void                  *reserved,
  const FWP_BYTE_BLOB   *vSwitchId,
  NDIS_SWITCH_PORT_ID   vSwitchSourcePortId,
  NDIS_SWITCH_NIC_INDEX vSwitchSourceNicIndex,
  NET_BUFFER_LIST       *netBufferLists,
  FWPS_INJECT_COMPLETE  completionFn,
  HANDLE                completionContext
);

Parameters

injectionHandle

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

The addressFamily parameter is not used and should be set to AF_UNSPEC.

injectionContext

An optional handle to the injection context that can be retrieved with the FwpsQueryPacketInjectionState0 function.

flags

Reserved. Must be set to zero.

reserved

Reserved. Must be set to NULL.

vSwitchId

The virtual switch identifier that the filtering engine passed in the FWPS_INCOMING_VALUES0 structure to the callout driver's classifyFn callout function. This is the GUID of the virtual switch that is provided in an xxx_VSWITCH_ID field.

vSwitchSourcePortId

The virtual switch source port identifier.

vSwitchSourceNicIndex

The virtual switch source NIC index.

netBufferLists

A chain of NET_BUFFER_LIST structures to be injected into the virtual switch egress data path.

completionFn

A pointer to a completionFn callout function that is provided by the callout driver. The filter engine calls this function after the packet data, at the netBufferLists parameter, has been injected into the virtual switch egress data path. The completionFn function will be called once for each NET_BUFFER_LIST in the chain. completionFn must be specified when injecting cloned or created NET_BUFFER_LIST structures. This parameter can be NULL when injecting original unaltered NET_BUFFER_LIST structures that were received from the filter engine.

completionContext

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.

Return Value

The FwpsInjectvSwitchEthernetIngressAsync0 function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The virtual switch NET_BUFFER_LIST chain was successfully injected.
Other status codes
An error occurred.

Remarks

When a callout injects packets with FwpsInjectvSwitchEthernetIngressAsync0, the injected packets could be classified again if the packets match the same filter as they were originally classified. Therefore, like callouts at IP layers, virtual switch callouts must call the FwpsQueryPacketInjectionState0 function to protect against infinite packet inspections.

Requirements

   
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header fwpsk.h (include Fwpsk.h)
Library Fwpkclnt.lib
IRQL "<= DISPATCH_LEVEL"

See Also

FWPS_INCOMING_VALUES0

FwpsAllocateNetBufferAndNetBufferList0

FwpsInjectionHandleCreate0

FwpsQueryPacketInjectionState0

NET_BUFFER_LIST

completionFn