WMI 类限定符

下表列出了可用于描述驱动程序的 WMI 数据块和事件块的必需和可选的 MOF 类限定符。

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. 其他限定符与嵌入类无关,将被忽略。 有关嵌入类的详细信息,请参阅 驱动程序定义的 WMI 数据项

Dynamic and Static are standard MOF qualifiers. 有关其他标准 MOF 限定符的信息,请参阅 Microsoft Windows SDK。

Qualifier Description

Dynamic

指示数据提供程序在运行时提供数据块的实例,而不是在 MOF 文件中提供静态数据的实例。 All data and event blocks that a driver registers with WMI must be defined with the Dynamic qualifier.

Static

指示数据提供程序在 MOF 文件中提供静态数据的实例,而不是在运行时提供数据块的实例。 驱动程序不会向 WMI 注册静态数据块,因为静态数据驻留在 WMI 数据库中。 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")

(必需)指示类的提供程序是 WMI 提供程序。

WMI

(必需)指示该类是 WMI 类。

Description("description-string")

(Optional) Specifies a description of the block for the locale specified by the Locale qualifier. 如果已定义,WMI 客户端可以向用户显示说明字符串。 A driver writer can use Description to document a class.

Guid("guid-string")

(必需)以字符串格式指定唯一标识 WMI 块的 GUID。 驱动程序编写器应使用 guidgen.exe 或 uuidgen.exe(包含在 Windows SDK 中)为驱动程序的 MOF 文件中的每个数据块生成 GUID。 驱动程序在驱动程序注册其块时,以 GUID 格式将此值传递给 WMI。 然后,WMI 使用 GUID 在驱动程序的 MOF 资源中查找块的定义。

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. 单个 MOF 文件可以包含具有不同区域设置的块,但 MOF 文件中的所有块通常具有相同的区域设置。

WmiExpense(expense-value)

(可选)指定收集数据块所需的平均 CPU 周期数。 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.