Qualifiers Specific to the View Provider

The following lists the qualifiers use to define View Provider classes.

Note

The View provider class only supports NetBIOS names when using remote references. If you use an IP address or a DNS name in a remote reference, then the connection fails with a 0x800706ba error.

Direct

Data type: boolean

Used with view association properties to prevent association references from being mapped to a view reference.

The following example defines the property GroupComponent as an association reference that is not mapped in the view reference.

[Direct, key, PropertySources
{"GroupComponent"}]

HiddenDefault

Data type: boolean

Default value for a view class property based on a source class property with a different default value. The underlying source class is implied by the view.

For example, the source class Win32_ScheduledJob has a boolean property RunRepeatedly that indicates whether the job is to be carried out periodically or one time only. The default value of RunRepeatedly is not True for Win32_ScheduledJob, but is True for the view class.

#pragma namespace("\\\\.\\root\\ns_view")
[Union,
ViewSources{"select * from Win32_ScheduledJob where RunRepeatedly=True"},
ViewSpaces{"\\\\.\\root\\cimv2"},
dynamic,provider("MS_VIEW_INSTANCE_PROVIDER")]
Class View_PeriodicJob
{
 [key, PropertySources{"JobId"}]
 uint32 JobId;
 [PropertySources{"Command"}]
 string Command;
 [HiddenDefault,PropertySources{"RunRepeatedly"}]
 boolean Repeat = True;
};

JoinOn

Data type: string

Defines how source class instances are joined in join view classes. The following example shows how to use the JoinOn qualifier to join two source classes.

JoinOn("Win32Perf_RawProcess.IDProcess = Win32Perf_RawThread.IDProcess")

MethodSource

Data type: string array

Source method to execute for the view method. For similar syntax, see PropertySources Qualifier. The signature of the method must match the signature of the source class exactly. Copy the method signature from the MOF file that defines the source class. The example below defines a method from the ClearEventLog method of Win32_NTEventlogFile:

[implemented, MethodSource
{"ClearEventlog"}]
  uint32   VClearEventlog([in] string ArchiveFileName);

This qualifier is only valid when it is used with union views.

PostJoinFilter

Data type: string

WQL query to filter instances after they have been joined in a join class.

PropertySources

Data type: string array

Source properties from which a view class property gets data.

Union

Data type: boolean

Indicates whether you are defining a union class. Union views contain instances based on the union of source instances. For example, you might declare the following:

Union, ViewSources{"SELECT Handle, Name, CreationDate FROM Win32_Process", 
                   "SELECT Caption, Name, ProcessHandle FROM Win32_Thread"}.

ViewSources

Data type: string array

Set of WMI Query Language (WQL) queries that define the source instances and properties used in a specific view class. Positional correspondence of all the array qualifiers is important.

ViewSpaces

Data type: string array

Namespaces where the source instances are located.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008