Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
6.3 KiB

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