GetNames method
Collapse the table of content
Expand the table of content

IWbemContext::GetNames method

The IWbemContext::GetNames method returns a SAFEARRAY structure of all of the names of the named context values. After all the names are known, GetValue can be called on each name to retrieve the value. This technique is a way of accessing the context values that is different from calling the BeginEnumeration, Next, and EndEnumeration methods.

Syntax


HRESULT GetNames(
  [in]  LONG             lFlags,
  [out] SAFEARRAY (BSTR) **pNames
);

Parameters

lFlags [in]

Reserved. This parameter must be 0.

pNames [out]

This parameter cannot be NULL, but on entry it must point to NULL. If no error is returned, on exit pstrNames receives a pointer to a new SAFEARRAY structure of type VT_BSTR containing all the context value names. The caller must call SafeArrayDestroy on the returned pointer when the array is no longer required. If an error code is returned, the pointer is left unmodified.

Note  If there are no named values in the object, the call succeeds and returns an array of length 0.
 

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained within an HRESULT.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_S_NO_ERROR

The call succeeded.

Remarks

For more information about using SAFEARRAY structures of BSTR values, see Retrieving Part of a WMI Instance.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WbemCli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Esscli.dll;
Fastprox.dll;
FrameDyn.dll;
FrameDynOS.dll;
Wbemcomn.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipjobj.dll

See also

IWbemContext
IWbemContext::BeginEnumeration
IWbemContext::GetValue

 

 

Show:
© 2016 Microsoft