IWbemPath::GetScopeAsText method

The IWbemPath::GetScopeAsText method retrieves a scope in text format based on an index.

Syntax


HRESULT GetScopeAsText(
  [in]      ULONG  uIndex,
  [in, out] ULONG  *puTextBufSize,
  [out]     LPWSTR pszText
);

Parameters

uIndex [in]

Index of the scope.

puTextBufSize [in, out]

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

pszText [out]

Buffer where the scope is to be copied.

Return value

This method returns the following values.

S_OK

Method executed successfully.

WBEM_E_BUFFER_TOO_SMALL

Buffer is not large enough.

WBEM_E_INVALID_PARAMETER

Indicates one of three conditions:

  • The puTextBufSize parameter is NULL.
  • The puTextBufSize parameter 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 pszText. This is done by passing in a NULL pointer for the buffer, setting puTextBufSize to zero (0), and then making the call. When returned, puTextBufSize indicates how large a buffer is needed for pszText 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: