Registering as a WMI Data Provider

A driver that supports WMI must register as a WMI data provider to make its data and event blocks available to WMI clients. A driver typically registers with WMI when starting its device, after the device has been initialized to the point that the driver can handle WMI IRPs. During the registration process, the driver passes WMI a pointer to its device object and information about the data and event blocks it supports.

A driver registers with WMI in two phases:

  1. The driver calls IoWMIRegistrationControl with the action WMIREG_ACTION_REGISTER and a pointer to the device object passed to the driver's AddDevice routine.

  2. The driver handles the IRP_MN_REGINFO or IRP_MN_REGINFO_EX request that WMI sends in response to the driver's IoWMIRegistrationControl call. The Parameters.WMI.DataPath member of the IRP is set to WMIREGISTER and Parameters.WMI.ProviderId is set to the driver's device object pointer. The driver supplies WMI with registration information about its data and event blocks, either by using the WMI Library as described in Using the WMI Library to Register Blocks, or by handling the IRP_MN_REGINFO or IRP_MN_REGINFO_EX requests as described in Handling IRP_MN_REGINFO and IRP_MN_REGINFO_EX to Register Blocks.