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(
  ULONG  uIndex,
  ULONG  *puNameBufLength,
  LPWSTR pName
);

Parameters

uIndex

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

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

Namespace name.

Return Value

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

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

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header wmiutils.h
Library Wbemuuid.lib
DLL Wmiutils.dll

See Also

IWbemPath