FwpsInjectvSwitchEgressAsync0 function

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

Syntax

NTSTATUS NTAPI FwpsInjectvSwitchEthernetEgressAsync0(
  _In_      HANDLE injectionHandle,
  _In_opt_  HANDLE injectionContext,
  _In_      _Reserved_ UINT32 flags,
  _In_opt_  _Reserved_ void *reserved,
  _In_      const FWP_BYTE_BLOB *vSwitchId,
  _Inout_ NET_BUFFER_LIST *netBufferLists,
  _In_      FWPS_INJECT_COMPLETE completionFn,
  _In_opt_  HANDLE completionContext
);

Parameters

  • 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_VSWITCH. The addressFamily parameter is not used and should be set to AF_UNSPEC.

  • injectionContext [in, optional]
    An optional handle to the injection context that can be retrieved with the FwpsQueryPacketInjectionState0 function.

  • flags [in]
    Reserved. This parameter must be set to zero.

  • reserved [in, optional]
    Reserved. This parameter must be set to NULL.

  • vSwitchId [in]
    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.

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

  • completionFn [in]
    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 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 [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.

Return value

The FwpsInjectvSwitchEthernetEgressAsync0 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 FwpsInjectvSwitchEthernetEgressAsync0, 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.

Injection of modified packets is not allowed at the virtual switch egress layer. Such packets must be blocked or absorbed from the egress layer, modified, and reinjected at the virtual switch ingress layer.

Requirements

Version

Available starting with Windows 8.

Header

Fwpsk.h (include Fwpsk.h)

IRQL

<= DISPATCH_LEVEL

See also

completionFn

FWPS_INCOMING_VALUES0

FwpsAllocateNetBufferAndNetBufferList0

FwpsInjectionHandleCreate0

FwpsQueryPacketInjectionState0

NET_BUFFER_LIST

 

 

Send comments about this topic to Microsoft

Build date: 9/13/2012