IWbemPath::GetServer method

The IWbemPath::GetServer method retrieves the server portion of the path.

Syntax


HRESULT GetServer(
  [in, out]  ULONG *puNameBufLength,
  [in, out]  LPWSTR pszName
);

Parameters

puNameBufLength [in, out]

Upon input, this is the size in characters of the buffer pointed to by pszName. Upon return, this is the number of characters in the server name, including the NULL terminator.

pszName [in, out]

Server name.

Return value

This method returns the following values.

Return codeDescription
S_OK

Method executed successfully.

WBEM_E_BUFFER_TOO_SMALL

Buffer pointed to by pszName is too small.

WBEM_E_INVALID_PARAMETER

The puNameBufLength parameter is NULL or a buffer size is indicated when pszName is NULL.

WBEM_E_NOT_AVAILABLE

The server is NULL.

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 pszName. This is done by passing in a NULL pointer for the buffer, setting puNameBufLength to 0 (zero) and then making the call. Upon return, puNameBufLength indicates how large a buffer is needed for pszName 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:
© 2014 Microsoft