FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 callback function

The filter engine calls the vSwitchPolicyEventNotifyFn (FWPS_VSWITCH_POLICY_EVENT_CALLBACK0) callout function to notify the callout driver about virtual switch policy events.

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

Syntax

FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 FwpsVswitchPolicyEventCallback0;

NTSTATUS FwpsVswitchPolicyEventCallback0(
  void *notifyContext,
  void *completionContext,
  FWPS_VSWITCH_EVENT_TYPE eventType,
  const NDIS_SWITCH_PARAMETERS *vSwitch,
  const NDIS_SWITCH_PORT_PROPERTY_PARAMETERS *vSwitchPortProperty,
  const NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS *vSwitchPortPropertyDelete
)
{...}

Parameters

notifyContext

completionContext

eventType

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

vSwitch

vSwitchPortProperty

vSwitchPortPropertyDelete

Return Value

A callout's

FWPS_VSWITCH_POLICY_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 vSwitchPolicyEventNotifyFn function by calling the FwpsvSwitchEventsSubscribe0 function.

If the vSwitchPolicyEventNotifyFn callback is registered, the callout on the target host will be notified about the policy configured for the virtual switch port during live migration and before the migrating VM can run on the new host.

Without live migration, vSwitchPolicyEventNotifyFn will also be invoked for a VM save operation.

Changes to vendor filtering policies that are configured through the VMMS WMI interface are passed to the WFP virtual switch extension with OID requests. These OIDs carry a NDIS_SWITCH_PORT_PROPERTY_PARAMETERS structure with the PropertyType member set to the NdisSwitchPortPropertyTypeCustom type.

The WFP filter driver passes the information in the OID_SWITCH_PORT_PROPERTY_ADD OID request to vSwitchPolicyEventNotifyFn with the FWPS_VSWITCH_EVENT_POLICY_ADD type set in the eventType parameter to notify callout drivers about the addition of a policy property for a virtual switch port.

The WFP filter driver passes the information in the OID_SWITCH_PORT_PROPERTY_UPDATE OID request to vSwitchPolicyEventNotifyFn with the FWPS_VSWITCH_EVENT_POLICY_UPDATE type set in the eventType parameter to notify callout filter drivers about the update of a property for a virtual switch port policy.

These OIDs also include a property identifier GUID that uniquely identifies which WFP provider the policy belongs to. The property identifier GUID is provided when an vendor configures its policy through VMMS, and the GUID must be the same GUID the vendor uses to register its provider with WFP.

WFP attempts to match the property identifier GUID with the provider GUID specified from the FwpsvSwitchEventsSubscribe0 function. If there is a match, WFP invokes the corresponding vSwitchPolicyEventNotifyFn and passes the NDIS_SWITCH_PORT_PROPERTY_PARAMETERS structure to the callout.

The WFP filter driver passes the information in the OID_SWITCH_PORT_PROPERTY_DELETE OID request to vSwitchPolicyEventNotifyFn with the FWPS_VSWITCH_EVENT_POLICY_DELETE type set in the eventType parameter to notify callout filter drivers about the deletion of a policy property for a virtual switch port. The delete properties are specified in the NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS structure.

If the callout returns STATUS_PENDING from vSwitchPolicyEventNotifyFn, WFP returns STATUS_PENDING to the FilterOidRequest handler. The callout driver will call the FwpsvSwitchNotifyComplete0 function to complete the pending operation.

Requirements

   
Minimum supported client 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

FilterOidRequest

FwpsvSwitchEventsSubscribe0

FwpsvSwitchNotifyComplete0

NDIS_SWITCH_PARAMETERS

NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS

NDIS_SWITCH_PORT_PROPERTY_PARAMETERS

OID_SWITCH_PORT_PROPERTY_ADD

OID_SWITCH_PORT_PROPERTY_DELETE

OID_SWITCH_PORT_PROPERTY_UPDATE