FWPS_VSWITCH_LIFETIME_EVENT_CALLBACK0 routine

The filter engine calls the vSwitchLifetimeNotifyFn (FWPS_VSWITCH_LIFETIME_EVENT_CALLBACK0) callout function to notify the callout driver about create and delete events for a virtual switch.

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

Syntax


FWPS_VSWITCH_LIFETIME_EVENT_CALLBACK0 vSwitchLifetimeNotifyFn;

NTSTATUS NTAPI vSwitchLifetimeNotifyFn(
  _In_opt_  void *notifyContext,
  _In_      FWPS_VSWITCH_EVENT_TYPE eventType,
  _In_      const  NDIS_SWITCH_PARAMETERS *vSwitch,
  _In_opt_  const NDIS_SWITCH_PORT_ARRAY *vSwitchPorts,
  _In_opt_  const NDIS_SWITCH_NIC_ARRAY *vSwitchInterfaces
)
{ ... }

Parameters

notifyContext [in, optional]

A pointer to a context supplied 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.

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.

vSwitchPorts [in, optional]

A pointer to an NDIS_SWITCH_PORT_ARRAY structure that specifies an array of port configuration parameters. Each element in the array specifies the parameters for a port on a virtual switch.

vSwitchInterfaces [in, optional]

A pointer to an NDIS_SWITCH_NIC_ARRAY structure that specifies an array of miniport adapter configuration parameters. Each element in the array specifies the parameters for a virtual or physical miniport adapter that is attached to a port on a virtual switch.

Return value

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

Return codeDescription
STATUS_SUCCESS

The callout driver accepts the notification from the filter engine.

Other status codes

An error occurred.

 

Remarks

A callout driver registers a vSwitchLifetimeNotifyFn callback function by calling the FwpsvSwitchEventsSubscribe0 function.

If the vSwitchLifetimeNotifyFn callback is registered, the WFP filter driver notifies the callout driver when a virtual switch instance is created. Multiple instances of a virtual switch can be present in a Hyper-V host at the same time.

The WFP filter driver queries the OID_SWITCH_PARAMETERS OID in the FilterRestart function to obtain the virtual switch identifier that is associated with the current instance of the virtual switch. The WFP filter driver also queries the OID_SWITCH_NIC_ARRAY and OID_SWITCH_PORT_ARRAY OIDs to obtain the initial set of configured virtual NICs and virtual ports. The WFP filter driver passes the NDIS_SWITCH_PORT_ARRAY and NDIS_SWITCH_NIC_ARRAY structure information from the OIDs to vSwitchLifetimeNotifyFn with FWPS_VSWITCH_EVENT_VSWITCH_CREATE set in the eventType parameter.

In the WFP filter driver's FilterDetach, the filter calls with FWPS_VSWITCH_EVENT_VSWITCH_DELETE set in the eventTypevSwitchLifetimeNotifyFn parameter.

A callout driver cannot return STATUS_PENDING from vSwitchLifetimeNotifyFn.

Requirements

Version

Available starting with Windows 8.

Header

Fwpsk.h (include Fwpsk.h)

IRQL

<= DISPATCH_LEVEL

See also

FilterDetach
FilterRestart
FWPS_VSWITCH_EVENT_TYPE
FWPS_VSWITCH_PORT_EVENT_CALLBACK0
FwpsvSwitchEventsSubscribe0
FwpsvSwitchNotifyComplete0
NDIS_SWITCH_NIC_ARRAY
NDIS_SWITCH_PORT_ARRAY
NDIS_SWITCH_PARAMETERS
NdisFRestartComplete
OID_SWITCH_NIC_ARRAY
OID_SWITCH_PARAMETERS
OID_SWITCH_PORT_ARRAY
Callout Driver Callout Functions

 

 

Send comments about this topic to Microsoft

Afficher:
© 2014 Microsoft