EN
此内容没有您的语言版本,但有英语版本。

MI_Context_RegisterCancel function

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

Syntax


 MI_INLINE MI_Result MI_Context_RegisterCancel(
  _In_      MI_Context *context,
  _In_      MI_CancelCallback callback,
  _In_opt_  void *callbackData
);

Parameters

context [in]

Request context.

callback [in]

Function that will be called if the operation is canceled.

callbackData [in, optional]

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.

Return codeDescription
MI_RESULT_OK

The operation succeeded.

MI_RESULT_SERVER_LIMITS_EXCEEDED

There is not enough memory to complete the request.

MI_RESULT_INVALID_PARAMETER

One or more parameters passed to the function were not valid.

MI_RESULT_FAILED

A failure not covered by other MI_Result error 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

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Redistributable

Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2

Header

Mi.h

See also

MI_Context
MI_CancelCallback
MI_CancellationReason

 

 

显示:
© 2014 Microsoft