[The Provider class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]
The PutInstance method updates an instance.
HRESULT PutInstance( const CInstance & newInstance, long lFlags );
Instance that is updated.
Bitmask of flags with information about the update operation. This is the value specified by the client in the IWbemServices::PutInstance method.
The following flag is handled by (and filtered out) by WMI:
The default framework provider implementation of this method returns WBEM_E_PROVIDER_NOT_CAPABLE to the calling method. The IWbemServices::PutInstance method lists the most common return values, although you can choose to return any COM return code.
WMI invokes PutInstance when a client calls IWbemServices::PutInstance against your class. You must implement PutInstance if your framework provider updates instances. The following list describes a common implementation of PutInstance:
Examine the key properties passed in by the client with the Get methods for CInstance, such as CInstance::GetCHString.
Your implementation should determine if your provider supports the changes requested by the client.
- Create or update the appropriate managed object, as necessary.
Return the appropriate return value.
If your provider does not support the changes requested by the client, you should return an appropriate error code. For a complete listing of valid error codes, see IWbemServices::PutInstance.
|Windows version||Windows Vista Windows Server 2008|
|Header||provider.h (include FwCommon.h)|