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(
  ULONG  uKeyIx,
  ULONG  uFlags,
  ULONG  *puNameBufSize,
  LPWSTR pszKeyName,
  ULONG  *puKeyValBufSize,
  LPVOID pKeyVal,
  ULONG  *puApparentCimType
);

Parameters

uKeyIx

Key index beginning at 0 (zero).

uFlags

Reserved. Must be 0 (zero).

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.

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.

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.

pKeyVal

Buffer where data is to be copied.

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

   
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