Expand Minimize

MI_Context_PostError function

Providers call this function to post a return code to the client in response to a request.

Syntax


 MI_INLINE MI_Result MI_Context_PostError(
  _In_  MI_Context *context,
  MI_Uint32 resultCode,
  _In_z_ const MI_Char *resultType,
  _In_z_ const MI_Char *errorMessage
);

Parameters

context [in]

A pointer to the request context.

resultCode

The Result code to be sent to the client.

resultType

A null-terminated string that represents the type of the result code. The string can be one of these values or an arbitrary value defined by the provider.

FlagsMeaning
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

 

errorMessage

A null-terminated string that represents the error message to be sent to the client. The message should be in the requested UI locale, if possible.

Return value

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

After an error is posted, the request context must not be used, because it becomes invalid at this point.

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_WriteError

 

 

Show:
© 2015 Microsoft