The IWbemContext::SetValue method creates or overwrites a named context value.
HRESULT SetValue( LPCWSTR wszName, long lFlags, VARIANT *pValue );
Cannot be NULL. It is a read-only pointer that indicates the context value name. This value must be null-terminated.
Reserved. This parameter must be 0 (zero).
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.
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.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||wbemcli.h (include Wbemidl.h)|
|DLL||Esscli.dll; Fastprox.dll; FrameDyn.dll; FrameDynOS.dll; Wbemcomn.dll; Wbemcore.dll; Wbemess.dll; Wmipjobj.dll|