IWbemObjectAccess interface (wbemcli.h)

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.


The IWbemObjectAccess interface inherits from the IUnknown interface. IWbemObjectAccess also has these types of members:


The IWbemObjectAccess interface has these methods.


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.

The GetPropertyInfoByHandle method returns the name and data type of the property that is associated with a property handle.

The Lock method prevents other threads from updating an IWbemObjectAccess object until it is unlocked.

The ReadDWORD method reads 32 bits of property data using a property handle.

The ReadPropertyValue method returns a specified number of bytes of a property associated with a property handle.

The ReadQWORD method reads 64 bits of property data identified by a property handle.

The Unlock method allows other threads to update the property values of an IWbemObjectAccess object.

The WriteDWORD method writes 32 bits of data to a property identified by a property handle.

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.

The WriteQWORD method writes 64 bits of data to a property by using a property handle.


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.


Requirement Value
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