IWbemObjectAccess interface

The IWbemObjectAccess interface provides access to the methods and properties of an object. An IWbemObjectAccess object is a container for an instance updated by a refresher. With the IWbemObjectAccess interface, you can get and set properties by using property handles instead of object property names.

Note  This interface is not implemented by client applications or providers under any circumstances. The implementation provided by WMI is the only one that is supported. A pointer to the interface can be retrieved by calling IWbemClassObject::QueryInterface.
 

Methods

The IWbemObjectAccess interface has these methods.

Method Description
IWbemObjectAccess::GetPropertyHandle The GetPropertyHandle method returns a unique handle that identifies a property. You can use this handle to identify properties when using IWbemObjectAccess methods to read or write property values.
IWbemObjectAccess::GetPropertyInfoByHandle The GetPropertyInfoByHandle method returns the name and data type of the property that is associated with a property handle.
IWbemObjectAccess::Lock The Lock method prevents other threads from updating an IWbemObjectAccess object until it is unlocked.
IWbemObjectAccess::ReadDWORD The ReadDWORD method reads 32 bits of property data using a property handle.
IWbemObjectAccess::ReadPropertyValue The ReadPropertyValue method returns a specified number of bytes of a property associated with a property handle.
IWbemObjectAccess::ReadQWORD The ReadQWORD method reads 64 bits of property data identified by a property handle.
IWbemObjectAccess::Unlock The Unlock method allows other threads to update the property values of an IWbemObjectAccess object.
IWbemObjectAccess::WriteDWORD The WriteDWORD method writes 32 bits of data to a property identified by a property handle.
IWbemObjectAccess::WritePropertyValue The WritePropertyValue method writes a specified number of bytes to a property identified by a property handle. Use this method to set string and all other non-DWORD or non-QWORD data.
IWbemObjectAccess::WriteQWORD The WriteQWORD method writes 64 bits of data to a property by using a property handle.

Remarks

The IWbemObjectAccess methods that read and write data perform very little data validation. Because IWbemObjectAccess methods directly access properties, you can get and set properties much more rapidly than you can using standard object access techniques such as IWbemClassObject::Get and IWbemClassObject::Put.

Note  To maximize its speed, IWbemObjectAccess is completely unchecked. It is the responsibility of the user to ensure that all handles are proper, and that write buffers are correctly sized. Read and write operations are not intrinsically thread-safe. You should call the IWbemObjectAccess::Lock and IWbemObjectAccess::Unlock methods to prevent IWbemObjectAccess objects from concurrent access on multiple threads.
 
Property handles are the same for all instances of a class. Therefore, it is only necessary to retrieve a handle one time.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wbemcli.h (include Wbemidl.h)

See Also

Accessing Performance Data in C++

Accessing WMI Preinstalled Performance Classes

COM API for WMI

IWbemRefresher