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

MI_Context_WriteError function

Sends an error code and error message to the client.

Syntax


 MI_INLINE MI_Result MI_Context_WriteError(
  _In_   MI_Context *context,
  MI_Uint32 resultCode,
  _In_z_ const MI_Char *resultType,
  _In_z_ const MI_Char *errorMessage,
  _Out_  MI_Boolean *flag
);

Parameters

context [in]

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:

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

flag [out]

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.

Return code/valueDescription
MI_RESULT_OK
0

The operation succeeded. If this value is used then will the client-side APIs will not receive an error code, but will receive a success code.

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

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

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
MI_Context_PostError

 

 

显示:
© 2014 Microsoft