MI_Context_WriteError function (mi.h)

Sends an error code and error message to the client.

Syntax

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteError(
  [in]  MI_Context    *context,
        MI_Uint32     resultCode,
        const MI_Char *resultType,
        const MI_Char *errorMessage,
  [out] MI_Boolean    *flag
);

Parameters

[in] context

Request context.

resultCode

Result code to send to the client.

resultType

A null-terminated string that represents the type of the result code, which may (but is not required to) contain one of these values:

MI_RESULT_TYPE_MI ("MI")

MI result type.

MI_RESULT_TYPE_HRESULT ("HRESULT")

HRESULT (COM return type) result type.

MI_RESULT_TYPE_WIN32 ("WIN32")

Win32 result type. See System Error Codes.

errorMessage

A null-terminated string that represents the error message to accompany the result code. This message should be localized based on the client's locale request (retrieved through the MI_Context_GetLocale function).

[out] flag

On return, flag contains MI_TRUE if provider should continue execution. Otherwise, the returned value will be MI_FALSE.

Return value

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

Remarks

The operation is not terminated by this call, although the client has the option to indicate that the operation should be continued or canceled.

If the client does not ask for MI_Context_WriteError messages, the function will give an automatic response.

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

MI_Context_PostError