IWbemContext::SetValue method

The IWbemContext::SetValue method creates or overwrites a named context value.

Syntax


HRESULT SetValue(
  [in] LPCWSTR strName,
  [in] LONG    lFlags,
  [in] VARIANT *pValue
);

Parameters

strName [in]

Cannot be NULL. It is a read-only pointer that indicates the context value name. This value must be null-terminated.

lFlags [in]

Reserved. This parameter must be 0 (zero).

pValue [in]

Must point to a valid VARIANT, which is treated as read-only. The value in the VARIANT becomes the named context value. An entire IWbemClassObject object can be stored as well as a simple value by enclosing it in a VARIANT that uses the VT_UNKNOWN type. The caller must execute QueryInterface on the IWbemClassObject object by asking for IID_IUnknown, and by using the returned pointer in the VARIANT.

If pValue is to contain an embedded IWbemClassObject object, the caller must call IWbemClassObject::QueryInterface for IID_IUnknown and place the resulting pointer in the VARIANT by using a type of VT_UNKNOWN. The original embedded object is copied during the write operation, and so cannot be modified by the operation.

Return value

This method returns an HRESULT that indicates the status of a method call. The following list lists and describes the values contained in an HRESULT.

WBEM_E_INVALID_PARAMETER

An invalid parameter is specified.

WBEM_E_OUT_OF_MEMORY

There is not enough memory to complete the operation.

WBEM_E_FAILED

There is a general failure.

WBEM_S_NO_ERROR

The call succeeded.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WbemCli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Esscli.dll;
Fastprox.dll;
FrameDyn.dll;
FrameDynOS.dll;
Wbemcomn.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipjobj.dll

See also

IWbemContext
IWbemContext::GetValue

 

 

Show: