Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IWbemPath::GetNamespaceAt method

The IWbemPath::GetNamespaceAt method retrieves a namespace based upon its index. The leftmost namespace in the path has an index of 0 with each namespace moving to the right having a progressively higher index value.

Syntax


HRESULT GetNamespaceAt(
  [in]      ULONG  uIndex,
  [in, out] ULONG  *puNameBufLength,
  [in, out] LPWSTR pName
);

Parameters

uIndex [in]

Index of the namespace to be read. The leftmost namespace in the path is index 0 with each namespace to the right having a progressively higher index value. The maximum permitted value is one less than the current number of namespaces.

puNameBufLength [in, out]

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

pName [in, out]

Namespace name.

Return value

This method returns an HRESULT indicating the status of the method call.

Return codeDescription
S_OK

Method executed successfully.

WBEM_E_INVALID_PARAMETER

Indicates one of three conditions:

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

Out of memory.

 

Remarks

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

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wmiutils.h

Library

Wbemuuid.lib

DLL

Wmiutils.dll

See also

IWbemPath

 

 

Show:
© 2015 Microsoft