IWbemPathKeyList::GetKey2 method (wmiutils.h)

The IWbemPathKeyList::GetKey2 method retrieves a key name or value, and returns the value as a VARIANT. A key is indexed from 0 (zero), but the key order is not significant.

Syntax

HRESULT GetKey2(
  ULONG   uKeyIx,
  ULONG   uFlags,
  ULONG   *puNameBufSize,
  LPWSTR  pszKeyName,
  VARIANT *pKeyValue,
  ULONG   *puApparentCimType
);

Parameters

uKeyIx

Key index begins at 0 (zero).

uFlags

Reserved. Must be 0 (zero).

puNameBufSize

Caller sets this parameter to the number of characters that the name buffer can hold. When successful, this is set to the number of characters that are copied into the buffer—including the terminating NULL.

pszKeyName

Buffer into which the name is copied. Because not all keys have a name, this parameter value is NULL for an implicit key.

pKeyValue

Pointer to a variant that contains the key value.

puApparentCimType

Pointer to a long integer that is set to the CIM type.

Return value

This method returns an HRESULT that indicates the status of the method call.

Remarks

This method can be used to determine how big a buffer is needed by passing in a NULL pointer for the buffer and setting its size parameter to 0 (zero). When returned, the buffer size parameter indicates the size buffer that is needed for the string and its NULL terminator.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wmiutils.h
Library Wbemuuid.lib
DLL Wmiutils.dll

See also

IWbemPath

IWbemPathKeyList

IWbemPathKeyList::GetKey