IWbemClassObject::GetPropertyOrigin method

The IWbemClassObject::GetPropertyOrigin method retrieves the name of the class in which a particular property was introduced. For classes with deep inheritance hierarchies, it is often desirable to know which properties were declared in which classes. If the object does not inherit from a parent class, as in the case of a base class, for example, then the current class name is returned.

Syntax


HRESULT GetPropertyOrigin(
  [in]  LPCWSTR wszName,
  [out] BSTR    *pstrClassName
);

Parameters

wszName [in]

Property name for which the owning class name is desired. This must point to a valid LPCWSTR, which is treated as read-only.

pstrClassName [out]

Pointer to the address of a new BSTR that receives the parent class name. To prevent memory leaks in the client process, the caller must call SysFreeString when the name is no longer required. This parameter must not point to a valid string before the method is called because this is an output parameter, and this pointer is not deallocated after the call is complete.

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained within an HRESULT. For general HRESULT values, see System Error Codes.

WBEM_E_FAILED

There has been a general failure.

WBEM_E_INVALID_PARAMETER

One or more parameters was not valid.

WBEM_E_NOT_FOUND

The specified property does not exist.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_S_NO_ERROR

The call succeeded.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WbemCli.h (include Wbemidl.h)

IDL

WbemCli.idl

Library

WbemUuid.lib

DLL

CIMWin32.dll;
Esscli.dll;
Fastprox.dll;
FrameDyn.dll;
FrameDynOS.dll;
Krnlprov.dll;
Ncprov.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipiprt.dll

CLSID

CLSID_WbemClassObject is defined as 9A653086-174F-11d2-B5F9-00104B703EFD

IID

IID_IWbemClassObject is defined as dc12a681-737f-11cf-884d-00aa004b2e24

See also

IWbemClassObject
IWbemClassObject::InheritsFrom

 

 

Show: