IWbemPathKeyList::GetKey method (wmiutils.h)

The IWbemPathKeyList::GetKey method retrieves a key's name or value. Keys are indexed from 0 (zero), though the order of the keys is not significant.

Syntax

HRESULT GetKey(
  [in]      ULONG  uKeyIx,
  [in]      ULONG  uFlags,
  [in, out] ULONG  *puNameBufSize,
  [in, out] LPWSTR pszKeyName,
  [in, out] ULONG  *puKeyValBufSize,
  [in, out] LPVOID pKeyVal,
  [in, out] ULONG  *puApparentCimType
);

Parameters

[in] uKeyIx

Key index beginning at 0 (zero).

[in] uFlags

Reserved. Must be 0 (zero).

[in, out] puNameBufSize

Caller sets this to the number of characters that the name buffer can hold. Upon success, this is set to the number of characters copied into the buffer including the terminating NULL.

[in, out] pszKeyName

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

[in, out] puKeyValBufSize

Caller sets this to the number of characters that the value buffer can hold. Upon success, this is set to the number of characters copied into the buffer including the NULL terminator.

[in, out] pKeyVal

Buffer where data is to be copied.

[in, out] puApparentCimType

Pointer to a long which is set to the CIM type.

Return value

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

Remarks

It is a recommended practice to determine how big a buffer is needed by calling this method, passing in a NULL pointer for the buffer, and setting its size parameter to 0 (zero). Upon return, the size parameter of the buffer indicates how large of a buffer is needed for the string and its NULL terminator. Then you can call the method to get the buffer value.

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::GetKey2