IWbemPath::GetScope method

The IWbemPath::GetScope method retrieves a scope based upon an index. This method retrieves the class name and a IWbemPathKeyList pointer so that the details of the keys can be retrieved.

Syntax


HRESULT GetScope(
  [in]      ULONG            uIndex,
  [in, out] ULONG            *puClassNameBufSize,
  [out]     LPWSTR           pszClass,
  [out]     IWbemPathKeyList **pKeyList
);

Parameters

uIndex [in]

Index of the scope.

puClassNameBufSize [in, out]

Caller sets this to the number of characters that the buffer can hold. Upon success, this is set to the number of characters copied into the buffer including the NULL terminator.

pszClass [out]

Buffer where the scope is to be copied.

pKeyList [out]

Pointer to an IWbemPathKeyList object.

Return value

This method returns the following values.

S_OK

Method executed successfully.

WBEM_E_BUFFER_TOO_SMALL

Buffer not large enough.

WBEM_E_INVALID_PARAMETER

Indicates one of three conditions:

  • The puClassNameBufSize is NULL.
  • The puClassNameBufSize indicates a nonzero length buffer, but the buffer is NULL.
  • The index value is out of range.
WBEM_E_OUT_OF_MEMORY

Insufficient memory to perform this method.

Remarks

This method can be used to determine how big a buffer is needed for pszClass. This is done by passing in a NULL pointer for the buffer, setting puClassNameBufSize to 0 and then making the call. Upon return, puClassNameBufSize indicates how large of a buffer is needed for pszClass and its terminating NULL character.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wmiutils.h

Library

Wbemuuid.lib

DLL

Wmiutils.dll

See also

IWbemPath

 

 

Show: