Bewerken

Delen via


FwpsInjectvSwitchEthernetIngressAsync0 function (fwpsk.h)

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(
  [in]           HANDLE                injectionHandle,
  [in, optional] HANDLE                injectionContext,
  [in]           UINT32                flags,
  [in, optional] void                  *reserved,
  [in]           const FWP_BYTE_BLOB   *vSwitchId,
  [in]           NDIS_SWITCH_PORT_ID   vSwitchSourcePortId,
  [in]           NDIS_SWITCH_NIC_INDEX vSwitchSourceNicIndex,
                 NET_BUFFER_LIST       *netBufferLists,
  [in]           FWPS_INJECT_COMPLETE  completionFn,
  [in, optional] HANDLE                completionContext
);

Parameters

[in] injectionHandle

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

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

[in, optional] injectionContext

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

[in] flags

Reserved. Must be set to zero.

[in, optional] reserved

Reserved. Must be set to NULL.

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

[in] vSwitchSourcePortId

The virtual switch source port identifier.

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

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

[in, optional] 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

Requirement Value
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