1 // This is a part of the Active Template Library.
2 // Copyright (C) Microsoft Corporation
3 // All rights reserved.
5 // This source code is only intended as a supplement to the
6 // Active Template Library Reference and related
7 // electronic documentation provided with the library.
8 // See these sources for detailed information regarding the
9 // Active Template Library product.
15 #pragma pack(push,_ATL_PACKING)
18 #define VALIDATION_S_OK 0x00000000
19 #define VALIDATION_S_EMPTY 0x00000001
20 #define VALIDATION_E_PARAMNOTFOUND 0x00000002
21 #define VALIDATION_E_LENGTHMIN 0x80000083
22 #define VALIDATION_E_LENGTHMAX 0x80000084
23 #define VALIDATION_E_INVALIDLENGTH 0x80000080
24 #define VALIDATION_E_INVALIDPARAM 0x80000005
25 #define VALIDATION_E_FAIL 0x80000006
27 #define VALIDATION_SUCCEEDED(x) (((x == VALIDATION_S_OK) || (x == VALIDATION_S_EMPTY )))
29 typedef DWORD HTTP_CODE
;
31 #define HTTP_ERROR(err, sub) ((HTTP_CODE)(DWORD_PTR)MAKELONG((WORD)err, (WORD)sub))
32 #define HTTP_ERROR_CODE(err) ((DWORD)LOWORD(err))
33 #define HTTP_SUBERROR_CODE(err) ((DWORD)HIWORD(err))
34 #define HTTP_SUCCESS HTTP_ERROR(0, 0)
37 #define ISE_SUBERR_BADSRF 1
38 #define ISE_SUBERR_HNDLFAIL 2
39 #define ISE_SUBERR_SYSOBJFAIL 3
40 #define ISE_SUBERR_READFILEFAIL 4
41 #define ISE_SUBERR_LOADFILEFAIL 6
42 #define ISE_SUBERR_LOADLIB 7
43 #define ISE_SUBERR_HANDLERIF 8
44 #define ISE_SUBERR_OUTOFMEM 9
45 #define ISE_SUBERR_UNEXPECTED 10
46 #define ISE_SUBERR_STENCIL_INVALIDFUNCOFFSET 11
47 #define ISE_SUBERR_STENCIL_MISMATCHWHILE 12
48 #define ISE_SUBERR_STENCIL_MISMATCHIF 13
49 #define ISE_SUBERR_STENCIL_UNEXPECTEDTYPE 14
50 #define ISE_SUBERR_STENCIL_INVALIDINDEX 15
51 #define ISE_SUBERR_STENCIL_INDEXOUTOFRANGE 16
52 #define ISE_SUBERR_STENCIL_PARSE_FAIL 17
53 #define ISE_SUBERR_STENCIL_LOAD_FAIL 18
54 #define ISE_SUBERR_HANDLER_NOT_FOUND 19
55 #define ISE_SUBERR_BAD_HANDLER_TAG 20
56 #define ISE_SUBERR_NO_HANDLER_TAG 21
57 #define ISE_SUBERR_LONGMETHODNAME 22
58 #define ISE_SUBERR_LONGHANDLERNAME 23
59 #define ISE_SUBERR_IMPERSONATIONFAILED 24
60 #define ISE_SUBERR_ISAPISTARTUPFAILED 25
61 #define ISE_SUBERR_SOAPNOSOAPACTION 26
62 #define SUBERR_NO_PROCESS 27
63 #define SUBERR_S_FALSE 28
64 #define SUBERR_ASYNC 29
65 #define SUBERR_ASYNC_DONE 30
66 #define SUBERR_ASYNC_NOFLUSH 31
67 #define SUBERR_ASYNC_NOFLUSH_DONE 32
68 #define SUBERR_NO_CACHE 33
69 #define DBG_SUBERR_ALREADY_DEBUGGING 34
70 #define DBG_SUBERR_NOT_DEBUGGING 35
71 #define DBG_SUBERR_INVALID_SESSION 36
72 #define DBG_SUBERR_BAD_ID 37
73 #define DBG_SUBERR_COCREATE 38
74 #define DBG_SUBERR_ATTACH 39
77 #define HTTP_FAIL HTTP_ERROR(500, SUBERR_NONE)
78 #define HTTP_SUCCESS_NO_PROCESS HTTP_ERROR(200, SUBERR_NO_PROCESS)
79 #define HTTP_S_FALSE HTTP_ERROR(HTTP_ERROR_CODE(HTTP_SUCCESS), SUBERR_S_FALSE)
80 #define HTTP_SUCCESS_ASYNC HTTP_ERROR(200, SUBERR_ASYNC)
81 #define HTTP_SUCCESS_ASYNC_DONE HTTP_ERROR(200, SUBERR_ASYNC_DONE)
82 #define HTTP_SUCCESS_ASYNC_NOFLUSH HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH)
83 #define HTTP_SUCCESS_ASYNC_NOFLUSH_DONE HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH_DONE)
84 #define HTTP_SUCCESS_NO_CACHE HTTP_ERROR(200, SUBERR_NO_CACHE)
85 #define HTTP_OK HTTP_ERROR(200, SUBERR_NONE)
86 #define HTTP_CONTINUE HTTP_ERROR(100, SUBERR_NONE)
88 #define HTTP_CREATED HTTP_ERROR(201, SUBERR_NONE)
89 #define HTTP_ACCEPTED HTTP_ERROR(202, SUBERR_NONE)
90 #define HTTP_NON_AUTHORITATIVE HTTP_ERROR(203, SUBERR_NONE)
91 #define HTTP_NO_CONTENT HTTP_ERROR(204, SUBERR_NONE)
92 #define HTTP_RESET_CONTENT HTTP_ERROR(205, SUBERR_NONE)
93 #define HTTP_PARTIAL_CONTENT HTTP_ERROR(206, SUBERR_NONE)
95 #define HTTP_MULTIPLE_CHOICES HTTP_ERROR(300, SUBERR_NONE)
96 #define HTTP_MOVED_PERMANENTLY HTTP_ERROR(301, SUBERR_NONE)
97 #define HTTP_FOUND HTTP_ERROR(302, SUBERR_NONE)
98 #define HTTP_SEE_OTHER HTTP_ERROR(303, SUBERR_NONE)
99 #define HTTP_NOT_MODIFIED HTTP_ERROR(304, SUBERR_NONE)
100 #define HTTP_USE_PROXY HTTP_ERROR(305, SUBERR_NONE)
101 #define HTTP_TEMPORARY_REDIRECT HTTP_ERROR(307, SUBERR_NONE)
103 #define HTTP_BAD_REQUEST HTTP_ERROR(400, SUBERR_NONE)
104 #define HTTP_UNAUTHORIZED HTTP_ERROR(401, SUBERR_NONE)
105 #define HTTP_PAYMENT_REQUIRED HTTP_ERROR(402, SUBERR_NONE)
106 #define HTTP_FORBIDDEN HTTP_ERROR(403, SUBERR_NONE)
107 #define HTTP_NOT_FOUND HTTP_ERROR(404, SUBERR_NONE)
108 #define HTTP_METHOD_NOT_ALLOWED HTTP_ERROR(405, SUBERR_NONE)
109 #define HTTP_NOT_ACCEPTABLE HTTP_ERROR(406, SUBERR_NONE)
110 #define HTTP_PROXY_AUTHENTICATION_REQUIRED HTTP_ERROR(407, SUBERR_NONE)
111 #define HTTP_REQUEST_TIMEOUT HTTP_ERROR(408, SUBERR_NONE)
112 #define HTTP_CONFLICT HTTP_ERROR(409, SUBERR_NONE)
113 #define HTTP_GONE HTTP_ERROR(410, SUBERR_NONE)
114 #define HTTP_LENGTH_REQUIRED HTTP_ERROR(411, SUBERR_NONE)
115 #define HTTP_PRECONDITION_FAILED HTTP_ERROR(412, SUBERR_NONE)
116 #define HTTP_REQUEST_ENTITY_TOO_LONG HTTP_ERROR(413, SUBERR_NONE)
117 #define HTTP_REQUEST_URI_TOO_LONG HTTP_ERROR(414, SUBERR_NONE)
118 #define HTTP_UNSUPPORTED_MEDIA_TYPE HTTP_ERROR(415, SUBERR_NONE)
119 #define HTTP_RANGE_NOT_SATISFIABLE HTTP_ERROR(416, SUBERR_NONE)
120 #define HTTP_EXPECTATION_FAILED HTTP_ERROR(417, SUBERR_NONE)
122 #define HTTP_INTERNAL_SERVER_ERROR HTTP_ERROR(500, SUBERR_NONE)
123 #define HTTP_NOT_IMPLEMENTED HTTP_ERROR(501, SUBERR_NONE)
124 #define HTTP_BAD_GATEWAY HTTP_ERROR(502, SUBERR_NONE)
125 #define HTTP_SERVICE_UNAVAILABLE HTTP_ERROR(503, SUBERR_NONE)
126 #define HTTP_GATEWAY_TIMEOUT HTTP_ERROR(504, SUBERR_NONE)
127 #define HTTP_VERSION_NOT_SUPPORTED HTTP_ERROR(505, SUBERR_NONE)
129 inline bool IsAsyncStatus(HTTP_CODE hcStatus
)
132 hcStatus
== HTTP_SUCCESS_ASYNC
||
133 hcStatus
== HTTP_SUCCESS_ASYNC_DONE
||
134 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH
||
135 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH_DONE
;
138 inline bool IsAsyncContinueStatus(HTTP_CODE hcStatus
)
141 hcStatus
== HTTP_SUCCESS_ASYNC
||
142 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH
;
145 inline bool IsAsyncDoneStatus(HTTP_CODE hcStatus
)
148 hcStatus
== HTTP_SUCCESS_ASYNC_DONE
||
149 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH_DONE
;
152 inline bool IsAsyncFlushStatus(HTTP_CODE hcStatus
)
155 hcStatus
== HTTP_SUCCESS_ASYNC
||
156 hcStatus
== HTTP_SUCCESS_ASYNC_DONE
;
159 inline bool IsAsyncNoFlushStatus(HTTP_CODE hcStatus
)
162 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH
||
163 hcStatus
== HTTP_SUCCESS_ASYNC_NOFLUSH_DONE
;
166 ATL_NOINLINE
inline HTTP_CODE
AtlsHttpError(WORD wStatus
, WORD wSubErr
) throw()
168 return HTTP_ERROR(wStatus
, wSubErr
);
174 #endif // __ATLSERR_H__