MI_Context_RegisterCancel function (mi.h)

Registers a callback that is invoked when the operation is canceled.

Syntax

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_RegisterCancel(
  [in]           MI_Context        *context,
  [in]           MI_CancelCallback callback,
  [in, optional] void              *callbackData
);

Parameters

[in] context

Request context.

[in] callback

Function that will be called if the operation is canceled.

[in, optional] callbackData

Data to be passed to the callback.

Return value

A value of the MI_Result enumeration that specifies the function return code. This can be one of the following codes.

Remarks

If a provider calls this function multiple times on the same context, only the last callback function will be called. Not all operations canceled on the client will reach the provider. If this is an operation that cannot register the cancellation callback, the function will return an error. This would mean the operation will run to completion. If the operation runs through to completion, the callback function will not be called.

Requirements

Requirement Value
Minimum supported client Windows 8
Minimum supported server Windows Server 2012
Target Platform Windows
Header mi.h
Redistributable Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2

See also

MI_CancelCallback

MI_CancellationReason

MI_Context