IWbemPathKeyList::GetKey2 method

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 *pKeyVal,
  [out]      ULONG *puApparentCimType
);

Parameters

uKeyIx [in]

Key index begins at 0 (zero).

uFlags [in]

Reserved. Must be 0 (zero).

puNameBufSize [in, out]

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

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

pKeyVal [out]

Pointer to a variant that contains the key value.

puApparentCimType [out]

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.

Return codeDescription
S_OK

Method executed successfully.

WBEM_E_INVALID_PARAMETER

One or more parameters are not valid.

WBEM_E_OUT_OF_MEMORY

Insufficient memory to perform the operation.

 

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 2003

Header

Wmiutils.h

Library

Wbemuuid.lib

DLL

Wmiutils.dll

See also

IWbemPath
IWbemPathKeyList
IWbemPathKeyList::GetKey

 

 

Show:
© 2014 Microsoft