IWbemPathKeyList::SetKey method

The IWbemPathKeyList::SetKey method sets the name or value pair for a key. If the key exists, it is replaced. If the name is empty, all existing keys are deleted.

Syntax


HRESULT SetKey(
  [in] LPCWSTR wszName,
  [in] ULONG   uFlags,
  [in] ULONG   uCimType,
  [in] LPVOID  pKeyVal
);

Parameters

wszName [in]

Key name, may be NULL.

uFlags [in]

Reserved. Must be 0 (zero).

uCimType [in]

CIMTYPE size.

pKeyVal [in]

Pointer to the data. The data pointed to varies depending on the uCimType parameter.

Return value

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

S_OK

Method executed successfully.

WBEM_E_INVALID_PARAMETER

One of three conditions:

  • The uFlags parameter is not 0 (zero).
  • The uCimType parameter is not valid.
  • The pKeyVal parameter is NULL.
WBEM_E_OUT_OF_MEMORY

Insufficient memory to perform the operation.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wmiutils.h

Library

Wbemuuid.lib

DLL

Wmiutils.dll

See also

IWbemPath
IWbemPathKeyList
IWbemPathKeyList::SetKey2

 

 

Show: