WMI 属性限定符

下表列出了可用于定义 WMI 数据或事件块中的项的必需和可选的 MOF 属性限定符。

The following are standard MOF qualifiers: key, read, write, ValueMap, and Values. 有关这些条件和其他标准 MOF 限定符的详细信息,请参阅 MOF 数据类型

Qualifier Description

key

指示数据项是唯一标识类的每个实例的键属性。 只能声明 InstanceName 属性。

read

指示 WMI 客户端可以读取数据项。

write

指示 WMI 客户端可以设置数据项。

BitMap

Specifies the bit positions of the corresponding string values that are specified in BitValues.

BitValues

指定表示数据项中设置的位的字符串值(标志名称)的列表。 The bit position of a flag is defined by the corresponding position specified in BitMap.

DefineValues

指定 WMI 工具套件编译为相应 #define 语句列表的枚举列表。

DisplayInHex

指定任何显示属性值的 WMI 客户端应在十六进制中执行此作。

DisplayName("string")

指定 WMI 客户端可用于显示为属性名称的标题。

MaxLen(uint)

For string properties, MaxLen specifies the maximum length of the string in characters. The uint value can be any 32-bit unsigned integer. If MaxLen is omitted, or uint is zero, then the length of the string is unlimited.

Values

指定此数据项的可能值的列表。 If the data item is an enumeration, ValueMap contains the index value that corresponds to the enumeration value specified in Values.

ValueMap

Specifies the integer values of the corresponding string values in Values.

WmiDataId(data-item-ID)

(必需)标识数据块中的数据项。 Data item IDs must be assigned to all items in a block except the required items InstanceName and Active. 必须在连续序列中分配数据项 ID,从 1 开始。 项的数据 ID 确定项在数据块实例中显示的顺序;MOF 类定义中项的顺序无关紧要。

WmiMethodId(method-item-ID)

标识数据块中的方法。

WmiSizeIs("data-item-name")

指定此块中另一个数据项的名称,该名称指示此数据项中可变长度数组中的元素数。 WmiSizeIs is valid only for data items that define arrays.

WmiScale(scale-factor)

指定缩放因子(以 10 为幂),驱动程序在返回此数据项的值时使用。 For example, if scale-factor is 5, the value returned by the driver is multiplied by 10⁵. If WmiScale is omitted, scale-factor can be assumed to be 0.

WmiTimeStamp

指定 64 位数据项是自 1/1/1/1601 以来的 100 纳秒单位的时间戳。 WmiTimeStamp is valid only for 64-bit data items.

WmiComplexity(level)

指定表示数据项的用户复杂性级别的整数值。 WMI 客户端可以使用该值来区分应提供给新手用户的数据项和数据项,而数据项应限制为更高级的用户。 零是最小值,较高的值表示更高的用户复杂性。 WmiComplexity defaults to zero if not specified.

WmiVolatility(interval)

指定此数据项更新之间的间隔(以毫秒为单位)。 For example, if a data item is updated once each second, interval would be 1000. A WMI client might check WmiVolatility to determine how often to query for a potentially new value. If WmiVolatility is omitted, interval is undefined.

WmiEventTrigger("data-item-name")

指定事件块中数据项的名称,WMI 客户端可以设置为定义事件的触发器值。 For example, if the event TooHot is qualified with WmiEventTrigger("TooHotTemperature"), a WMI client could set TooHotTemperature to instruct the driver to send the TooHot event when the device reached the user-specified value for TooHotTemperature. 通常,驱动程序将定义触发器值。 By exposing a WmiEventTrigger data item, the driver allows a client to control when a particular event is fired.

WmiEventRate("data-item-name")

指定事件块中数据项的名称,WMI 客户端可以设置为控制发送此事件的频率。 For example, if the data item TooHot is qualified with WmiEventRate("SendEventRate"), a WMI client user could set SendEventRate to instruct the driver to send TooHot at the user-specified interval.