Expand Minimize

MI_Context_WriteProgress function

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

context [in]

Request context.

activity [in]

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).

currentOperation [in]

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

statusDescription [in]

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.

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

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

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_Context_GetLocale

 

 

Show:
© 2014 Microsoft