FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 routine

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 vSwitchPolicyEventNotifyFn;

NTSTATUS NTAPI vSwitchPolicyEventNotifyFn(
  _In_opt_  void *notifyContext,
  _In_      void *completionContext,
  _In_      FWPS_VSWITCH_EVENT_TYPE eventType,
  _In_      const NDIS_SWITCH_PARAMETERS *vSwitch,
  _In_opt_  _When_(eventType == FWPS_VSWITCH_EVENT_POLICY_DELETE, _Null_) const NDIS_SWITCH_PORT_PROPERTY_PARAMETERS *vSwitchPortProperty,
  _In_opt_  _When_(eventType == FWPS_VSWITCH_EVENT_POLICY_DELETE, _Notnull_) const NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS *vSwitchPortPropertyDelete
)
{ ... }

Parameters

notifyContext [in, optional]

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

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

eventType [in]

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

vSwitch [in]

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.

vSwitchPortProperty [in, optional]

A pointer to an NDIS_SWITCH_PORT_PROPERTY_PARAMETERS structure. The virtual switch port property.

vSwitchPortPropertyDelete [in, optional]

A pointer to an NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS structure. The virtual switch port property.

Return value

A callout's FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 function returns one of the following NTSTATUS codes.

Return codeDescription
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

Version

Available starting with Windows 8.

Header

Fwpsk.h (include Fwpsk.h)

IRQL

<= DISPATCH_LEVEL

See also

FilterOidRequest
FWPS_VSWITCH_EVENT_TYPE
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
Callout Driver Callout Functions

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft