3.2.4.1.2 IWbemObjectSink::SetStatus Client Details

The client MUST call the IWbemObjectSink::SetStatus method operation to send the final status of the IWbemServices method operation by passing WBEM_STATUS_COMPLETE as an lFlags parameter and the operation return code as an HRESULT parameter. After calling IWbemObjectSink::SetStatus with final status information, the client MUST release the IWbemObjectSink interface and MUST NOT call any other methods of IWbemObjectSink.

When the reported operation status is success, the client MUST set the pObjParam parameter to NULL.

The client MAY call IWbemObjectSink::SetStatus multiple times during the operation execution to report the operation progress.<82> In this case, lFlags MUST be set to WBEM_STATUS_PROGRESS and the hResult parameter MUST contain the progress information.

When sending operation progress information, the client MAY call IWbemObjectSink::SetStatus any time before final status is sent.

The following applies when the WMI server acts as an IWbemObjectSink client.

For each asynchronous operation, there MUST only be one call at a time of either IWbemObjectSink::Indicate or IWbemObjectSink::SetStatus (for operation progress information). This is ensured by calling IWbemObjectSink::Indicate only if CallbackInProgress is FALSE. Set CallbackInProgress to TRUE before calling operation progress information by IWbemObjectSink::SetStatus, and reset to FALSE after the call returns. Operation progress by IWbemObjectSink::SetStatus MUST NOT be called if CallCancelled is TRUE.

If operation progress information by IWbemObjectSink::SetStatus returns an error, the server MUST do the following:

  1. Set CallCancelled to TRUE in AsyncOperationTable for the entry identified by this IWbemObjectSink.

  2. Send the final result with WBEM_E_CALL_CANCELLED.

  3. Remove the entry for this operation in AsyncOperationTable.