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(
  [in]      ULONG   uKeyIx,
  [in]      ULONG   uFlags,
  [in, out] ULONG   *puNameBufSize,
  [out]     LPWSTR  pszKeyName,
  [out]     VARIANT *pKeyValue,
  [out]     ULONG   *puApparentCimType
);

Parameters

[in] uKeyIx

Key index begins at 0 (zero).

[in] uFlags

Reserved. Must be 0 (zero).

[in, out] 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.

[out] pszKeyName

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

[out] pKeyValue

Pointer to a variant that contains the key value.

[out] 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

Requirement Value
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