1 krisbash 1.1 /*
2 **==============================================================================
3 **
4 ** Open Management Infrastructure (OMI)
5 **
6 ** Copyright (c) Microsoft Corporation
7 **
8 ** Licensed under the Apache License, Version 2.0 (the "License"); you may not
9 ** use this file except in compliance with the License. You may obtain a copy
10 ** of the License at
11 **
12 ** http://www.apache.org/licenses/LICENSE-2.0
13 **
14 ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 ** MERCHANTABLITY OR NON-INFRINGEMENT.
18 **
19 ** See the Apache 2 License for the specific language governing permissions
20 ** and limitations under the License.
21 **
22 krisbash 1.1 **==============================================================================
23 */
24
25 #ifndef _omi_error_errorutil_h
26 #define _omi_error_errorutil_h
27
28 #include "config.h"
29 #include <string.h>
30 #include <common.h>
31 #include <base/messages.h>
32
33 BEGIN_EXTERNC
34
35 //------------------------------------------------------------------------------
36 // Create PostResultMsg and serialize the error instance based on request message format
37 //
38 // Arguments:
39 // req -- Request message
40 // err -- error object. It is optional;
41 // errmsg -- final error message that needs to be posted, it is optional; If will be ignored if
42 // err argument was NOT null
43 krisbash 1.1 // r -- final result code; If will be ignored if err argument was NOT null
44 //
45 // Return:
46 // NULL if failed; Otherwise success
47 //------------------------------------------------------------------------------
48 PostResultMsg* PostResultMsg_NewAndSerialize(
49 _In_ Message* req,
50 _In_opt_ const MI_Instance* err,
51 _In_opt_z_ const MI_Char* errmsg,
52 _In_z_ const MI_Char *errorType,
53 _In_ MI_Uint32 r);
54
55 END_EXTERNC
56
57 #endif /* _omi_error_errorutil_h */
|