FWPS_VSWITCH_PORT_EVENT_CALLBACK0 callback function

The filter engine calls the

vSwitchPortEventNotifyFn (FWPS_VSWITCH_PORT_EVENT_CALLBACK0) callout function to notify the callout driver about events that are associated a virtual switch (vSwitch) port.

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

Syntax

FWPS_VSWITCH_PORT_EVENT_CALLBACK0 FwpsVswitchPortEventCallback0;

NTSTATUS FwpsVswitchPortEventCallback0(
  void *notifyContext,
  void *completionContext,
  FWPS_VSWITCH_EVENT_TYPE eventType,
  const NDIS_SWITCH_PARAMETERS *vSwitch,
  const NDIS_SWITCH_PORT_PARAMETERS *vSwitchPort
)
{...}

Parameters

*notifyContext

A pointer to a context provided by the callout driver. The driver passed this pointer to the notifyContext parameter of the FwpsvSwitchEventsSubscribe0 function. This parameter is optional and can be NULL.

*completionContext

A pointer to a completion context provided by the callout driver. This parameter is optional and can be NULL.

eventType

The type of virtual switch vSwitch event specified as one of the FWPS_VSWITCH_EVENT_TYPE enumeration values. For more information, see Remarks.

*vSwitch

A pointer to an NDIS_SWITCH_PARAMETERS structure that contains information about a virtual switch.

Note The information in the NDIS_SWITCH_PARAMETERS structure reflects the initial state of the virtual switch, not necessarily its current state. In particular, the NumSwitchPorts and IsActive members might still have their initial value of zero, unless a virtual switch PnP event has been triggered. Current state information can be found in the other parameters to this callback function.

*vSwitchPort

A pointer to an NDIS_SWITCH_PORT_PARAMETERS structure that contains parameters for a port on a vSwitch.

Return Value

A callout's

FWPS_VSWITCH_PORT_EVENT_CALLBACK0 function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The callout driver accepts the notification from the filter engine.
STATUS_PENDING
The operation is pending and will be completed later. The callout driver will call the FwpsvSwitchNotifyComplete0 function to complete the pending operation.
Other status codes
An error occurred.

Remarks

A callout driver registers a

vSwitchPortEventNotifyFn function by calling

the <a href="https://msdn.microsoft.com/library/windows/hardware/hh439687">FwpsvSwitchEventsSubscribe0</a>

function.

If the vSwitchPortEventNotifyFn callback is registered, the callout driver receives notifications for port creation and deletion.

If the eventType parameter is set to FWPS_VSWITCH_EVENT_PORT_CREATE, a vSwitch port was created. In this case, the vSwitch parameter identifies an NDIS_SWITCH_PARAMETERS structure that contains information about the virtual switch (vSwitch) and the NDIS_SWITCH_PORT_PARAMETERS parameter contains information about the port.

A callout can return STATUS_PENDING from vSwitchPortEventNotifyFn. In this case, the callout driver calls the FwpsvSwitchNotifyComplete0 function to complete the pending operation.

After the port is deleted, the WFP filter driver calls vSwitchPortEventNotifyFn with FWPS_VSWITCH_EVENT_PORT_DELETE set in the eventType parameter.

Requirements

   
Windows version Available starting with Windows 8.
Target Platform Windows
Header fwpsk.h (include Fwpsk.h)
IRQL "<= DISPATCH_LEVEL"

See Also

Callout Driver Callout Functions

FWPS_VSWITCH_EVENT_TYPE

FwpsvSwitchEventsSubscribe0

FwpsvSwitchNotifyComplete0

NDIS_SWITCH_PARAMETERS

NDIS_SWITCH_PORT_PARAMETERS