MI_Context_WriteProgress function (mi.h)

Sends a progress message to the client.

Syntax

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteProgress(
  [in] MI_Context    *context,
  [in] const MI_Char *activity,
  [in] const MI_Char *currentOperation,
  [in] const MI_Char *statusDescription,
       MI_Uint32     percentComplete,
       MI_Uint32     secondsRemaining
);

Parameters

[in] context

Request context.

[in] activity

A null-terminated string that represents the current activity. This string should be localized based on the client UI request (retrieved through the MI_Context_GetLocale function).

[in] currentOperation

A null-terminated string that represents the current operation being processed. This string should be localized based on the client UI request.

[in] statusDescription

A null-terminated string that represents the current status description. This string should be localized based on the client UI request.

percentComplete

Current percentage of completion. Passing 0xffffffff indicates that the percentage complete is unknown.

secondsRemaining

Estimated seconds remaining to complete the current operation. Passing 0xffffffff indicates that the time required to complete the current operation is unknown.

Return value

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

Remarks

A provider calls this function to indicate how far through an operation the provider is and how much time is remaining. A client can optionally register to receive these messages via an asynchronous callback. If a client does not register for these messages, the server will ignore the message. This function is particularly important for long running operations so the client does not think the operation has stopped responding. Do not send too many progress messages as it can cause a performance hit, but send them often enough that the client does not think the operation has stopped responding and possibly cancel the operation. (An interval range between 0.5 and 10 seconds is probably reasonable.) Also, if a progress message comes in during an operation, it will reset the operation timeout period to allow the operation to last longer than the operation timeout value. If the client does not register for this callback, though, it has no way of resetting the timeout value, so it may time out even when the provider sends a progress message.

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_Context

MI_Context_GetLocale