WdfWmiInstanceRegister method

[Applies to KMDF only]

The WdfWmiInstanceRegister method registers a specified instance of a WMI data provider with the system's WMI service.

Syntax


NTSTATUS WdfWmiInstanceRegister(
  [in] WDFWMIINSTANCE WmiInstance
);

Parameters

WmiInstance [in]

A handle to a WMI instance object that the driver obtained from a previous call to WdfWmiInstanceCreate.

Return value

WdfWmiInstanceRegister returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return codeDescription
STATUS_INVALID_DEVICE_REQUEST

The specified WMI instance has already been registered.

 

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

Provider instances are not available to WMI clients until they have been registered. Your driver must either call WdfWmiInstanceRegister or set the Register member of the instance's WDF_WMI_INSTANCE_CONFIG structure to TRUE.

For more information about the WdfWmiInstanceRegister method, see Registering Provider Instances. For more information about WMI, see Supporting WMI in Framework-Based Drivers.

WdfWmiInstanceRegister registers the provider instance synchronously (that is, before returning) if it is called at IRQL = PASSIVE_LEVEL and asynchronously if it is called at IRQL > PASSIVE_LEVEL.

Examples

The following code example registers a specified instance of a WMI data provider with the system's WMI service.


NTSTATUS  status;

status = WdfWmiInstanceRegister(wmiInstance);

Requirements

Target platform

Universal

Minimum KMDF version

1.0

Header

Wdfwmi.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WDF_WMI_INSTANCE_CONFIG
WdfWmiInstanceCreate
WdfWmiInstanceDeregister

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft