[The CInstance 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 Commit method returns the current instance to WMI.
HRESULT Commit( );
This method has no parameters.
Use the SUCCEEDED or FAILED macro on the returned HRESULT to determine success or failure of the method.
If the client cancels the query, the Commit method returns an error. A provider writer can use this fact to terminate an enumeration.
Also, framework providers should call this method to commit rather than Provider::Commit. Provider::Commit calls CInstance::Release automatically. Smart CInstance pointers cannot be used in this case because the smart CInstance pointer would call CInstance::Release in its destructor. If the release has already occurred, an exception will result. Issues of this type are best resolved by allowing the CInstance instance, or a smart pointer to it, to call CInstance::Release when it is appropriate.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||instance.h (include FwCommon.h)|