Muokkaa

Jaa


WMI Class Qualifiers

The following table lists the required and optional MOF class qualifiers that can be used to describe a driver's WMI data blocks and event blocks.

An embedded class, which is a class used solely as a data item in another class and not exposed as a WMI data block, requires only the WMI and Guid qualifiers. The other qualifiers are irrelevant to embedded classes and are ignored. For more information about embedded classes, see Driver-defined WMI Data Items.

Dynamic and Static are standard MOF qualifiers. For information about other standard MOF qualifiers, see the Microsoft Windows SDK.

Qualifier Description

Dynamic

Indicates that the data provider supplies instances of the data block at run time, rather than providing instances of static data in the MOF file. All data and event blocks that a driver registers with WMI must be defined with the Dynamic qualifier.

Static

Indicates that the data provider supplies instances of static data in the MOF file, rather than supplying instances of the data block at run time. A driver does not register static data blocks with WMI, because the static data resides in the WMI database. Classes marked as Static in the MOF file should not be registered by the driver's IRP_MN_REGINFO or IRP_MN_REGINFO_EX handlers.

Provider("WMIProv")

(Required) Indicates that the provider of the class is a WMI provider.

WMI

(Required) Indicates that the class is a WMI class.

Description("description-string")

(Optional) Specifies a description of the block for the locale specified by the Locale qualifier. If defined, WMI clients can display the description string to users. A driver writer can use Description to document a class.

Guid("guid-string")

(Required) Specifies the GUID, in string format, that uniquely identifies the block to WMI. A driver writer should generate a GUID for each data block in the driver's MOF file, using either guidgen.exe or uuidgen.exe (which are included in the Windows SDK). A driver passes this value in GUID format to WMI when the driver registers its blocks. WMI then uses the GUID to look up the block's definition in the driver's MOF resource.

Locale("MS</strong>locale-identifier")

(Optional) Specifies the language identifier and locale for the string specified by Description. For example, a locale-identifier of 0x409 specifies American English. A single MOF file can contain blocks with different locales, but typically all of the blocks in a MOF file have the same locale.

WmiExpense(expense-value)

(Optional) Specifies the average number of CPU cycles needed to collect data for the data block. For example, a WMI client might check a data block's WmiExpense value to determine how often to query for its data. If WmiExpense is omitted, expense-value is assumed to be 0. WmiExpense is unrelated to registering a data block as expensive to collect.