[This is preliminary documentation and subject to change.]
The IWbemClassObject::QueryInterface method determines if the object supports a particular COM interface. If it does, the system increases the object's reference count, and the application can use that interface immediately.
HRESULT IWbemClassObject::QueryInterface(
[in] REFIID riid,
[out] LPVOID *ppv
);
Returns standard COM error codes for QueryInterface. It returns S_OK if the call succeeds. This call will fail if the requested interface was not supported and the method returns E_NOINTERFACE.
When the application no longer needs the interface retrieved by a call to this method, it must call the Release method for that interface to free it. The QueryInterface method allows the extension of objects without interfering with existing or future functionality of the objects.
The QueryInterface method is part of the IUnknown interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.