FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 callback function (fwpsk.h)
The filter engine calls the vSwitchPolicyEventNotifyFn (FWPS_VSWITCH_POLICY_EVENT_CALLBACK0) callout function to notify the callout driver about virtual switch policy events.
Syntax
FWPS_VSWITCH_POLICY_EVENT_CALLBACK0 FwpsVswitchPolicyEventCallback0;
NTSTATUS FwpsVswitchPolicyEventCallback0(
[in, optional] void *notifyContext,
[in] void *completionContext,
[in] FWPS_VSWITCH_EVENT_TYPE eventType,
[in] const NDIS_SWITCH_PARAMETERS *vSwitch,
[in, optional] const NDIS_SWITCH_PORT_PROPERTY_PARAMETERS *vSwitchPortProperty,
[in, optional] const NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS *vSwitchPortPropertyDelete
)
{...}
Parameters
[in, optional] 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.
[in] completionContext
A pointer to a completion context provided by the callout driver. This parameter is optional and can be NULL.
[in] eventType
The type of virtual switch event specified as one of the FWPS_VSWITCH_EVENT_TYPE enumeration values. For more information, see Remarks.
[in] vSwitch
A pointer to an NDIS_SWITCH_PARAMETERS structure that contains information about a virtual switch.
[in, optional] vSwitchPortProperty
A pointer to an NDIS_SWITCH_PORT_PROPERTY_PARAMETERS structure. The virtual switch port property.
[in, optional] vSwitchPortPropertyDelete
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 code | Description |
---|---|
|
The callout driver accepts the notification from the filter engine. |
|
The operation is pending and will be completed later. The callout driver will call the FwpsvSwitchNotifyComplete0 function to complete the pending operation. |
|
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
Requirement | Value |
---|---|
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
NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS
NDIS_SWITCH_PORT_PROPERTY_PARAMETERS