IWbemClassObject::GetMethod method

The IWbemClassObject::GetMethod method returns information about the requested method. This call is only supported if the current object is a CIM class definition. Method information is not available from IWbemClassObject pointers which point to CIM instances.

Syntax


HRESULT GetMethod(
  [in]  LPCWSTR          wszName,
  [in]  LONG             lFlags,
  [out] IWbemClassObject **ppInSignature,
  [out] IWbemClassObject **ppOutSignature
);

Parameters

wszName [in]

The method name. This cannot be NULL, and must point to a valid LPCWSTR.

lFlags [in]

Reserved. This parameter must be 0.

ppInSignature [out]

A pointer that receives an IWbemClassObject pointer which describes the in parameters to the method. This parameter is ignored if set to NULL. Be aware that Windows Management can set the IWbemClassObject pointer to NULL if this method has no in parameters. For more information, see Remarks.

ppOutSignature [out]

A pointer that receives an IWbemClassObject pointer which describes the out-parameters to the method. This parameter will be ignored if set to NULL.

Return value

This method returns an HRESULT that indicates 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_S_NO_ERROR

The requested in and out parameter objects were returned.

WBEM_E_NOT_FOUND

The method did not exist.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the call.

Remarks

For a method, the in and out parameters are described as properties in an IWbemClassObject, an instance of the system class __Parameters.

For example, consider the following method:


Class MyClass{
    [key] string KeyVal;
    sint32 PropVal;
    sint32 ExampleMethod([in] sint32 Parm1, [in] uint32 Parm2, 
      [out] string Parm3);
};

In this example, the class has a single method. When the user calls IWbemClassObject::GetMethod, the ppInSignature parameter receives an IWbemClassObject object, which contains two properties: Parm1 and Parm2. The ppOutSignature parameter contains two properties, Parm3 and ReturnValue.

After filling in the property values of the ppInSignature object, the caller can use the object to execute the method by calling IWbemServices::ExecMethod or IWbemServices::ExecMethodAsync.

Note  The caller must call IWbemClassObject::Release on the ppInSignature and ppOutSignature pointers when these objects are no longer required.
 

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::PutMethod

 

 

Show: