[This is preliminary documentation and subject to change.]
The IWbemQualifierSet::Put method writes the named qualifier and value. If the qualifier does not exist, it is created. The new qualifier overwrites the previously existing value of the same name.
In some cases, it is not possible to write the value of a qualifier if it was propagated from another object. Propagated qualifiers are generally read-only, but they can be overridden in some cases. See Qualifier Flavors.
When writing the key qualifier, it is not necessary to specify any flavors or propagation rules.
HRESULT IWbemQualifierSet::Put(
[in] BSTR bstrName,
[in] VARIANT *pVal,
[in] LONG lFlavor,
);
Only variants of type VT_I4, VT_R8, VT_BSTR, VT_BOOL and arrays of types VT_BSTR, VT_I4, VT_R8, and VT_BOOL are supported.
WBEM_E_CANNOT_BE_KEY | There was an illegal attempt to specify a key qualifier on a property that cannot be a key. The keys are specified in the class definition for an object, and cannot be altered on a per-instance basis. |
WBEM_E_INVALID_PARAMETER | An invalid parameter was specified or the namespace could not be parsed. |
WBEM_E_INVALID_QUALIFIER_TYPE | The pVal parameter is not of a legal qualifier type. |
WBEM_E_OVERRIDE_NOT_ALLOWED | It is not possible to perform the IWbemQualifierSet::Put operation on this qualifier because the owning object does not permit overrides. |
WBEM_NO_ERROR | Success. |