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.

260 lines
11 KiB

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /****************************************************************************\
  5. * *
  6. * MVERROR.H *
  7. * *
  8. * Copyright (C) Microsoft Corporation 1993 - 1994. *
  9. * All Rights reserved. *
  10. * *
  11. ******************************************************************************
  12. * *
  13. * Module Intent: *
  14. * Defines constants used as error codes. *
  15. * *
  16. \****************************************************************************/
  17. #ifndef ERRB_DEFINED
  18. #define ERRB_DEFINED
  19. /*************************************************************************
  20. * Error management.
  21. *************************************************************************/
  22. typedef WORD ERR; // Use this for internal & external errors
  23. typedef ERR RC; // This should be phased out
  24. typedef WORD HCE; // User errors
  25. typedef WORD EP; // Error Phase
  26. /*************************************************************************
  27. *
  28. * CALLBACK FUNCTIONS PROTOTYPES
  29. *
  30. * User callback functions are needed in case:
  31. * - The application needs to support interrupt
  32. * - The application needs to display error messages its way
  33. * - The application needs to know the status of the process
  34. *************************************************************************/
  35. typedef ERR (FAR PASCAL *ERR_FUNC) (DWORD dwFlag, LPVOID pUserData, LPVOID pMessage);
  36. /*************************************************************************
  37. * Call back structure
  38. * Contains information about all callback functions
  39. *************************************************************************/
  40. #define ERRFLAG_INTERRUPT 0x01 // The processes should be cancelled
  41. #define ERRFLAG_STATUS 0x02 // High-level status messages
  42. #define ERRFLAG_STATUS_VERBOSE 0x04 // Low-level status messages
  43. #define ERRFLAG_ERROR 0x08 // Warning & Error messages
  44. #define ERRFLAG_STRING 0x10 // Debug string messages
  45. typedef struct fCallBack_msg
  46. {
  47. ERR_FUNC MessageFunc;
  48. LPVOID pUserData;
  49. DWORD dwFlags;
  50. } FCALLBACK_MSG, FAR * PFCALLBACK_MSG;
  51. // Error Phase values
  52. #define epNoFile 0
  53. #define epLine 1
  54. #define epTopic 2
  55. #define epOffset 3
  56. #define epMVBtopic 4
  57. #define epAliasLine 5
  58. #define epByteOffset 6
  59. // ***********************************************************************
  60. // This structure should be filled out and passed back in the case of
  61. // an error.
  62. // ***********************************************************************
  63. typedef struct
  64. {
  65. LPCSTR pchFile;
  66. LONG iLine;
  67. DWORD iTopic;
  68. DWORD fCustom; // If true then var1 is LPCSTR to custom error message
  69. DWORD var1, var2, var3; // Error parameters
  70. EP ep; // Error Phase
  71. HCE errCode;
  72. } ERRC, FAR *PERRC;
  73. #define CALLBACKKEY 0x524A4A44
  74. typedef struct
  75. {
  76. DWORD_PTR dwReserved;
  77. DWORD dwKey;
  78. FCALLBACK_MSG Callback;
  79. } CUSTOMSTRUCT, FAR *PCUSTOMSTRUCT;
  80. /*************************************************************************
  81. * Error management.
  82. *************************************************************************/
  83. /******************************************
  84. * Error structure. For internal use only
  85. ******************************************/
  86. typedef struct
  87. {
  88. ERR err; // Error code.
  89. LONG iUser; // Whatever you want.
  90. BYTE *aszFile; // Source file that caught an error.
  91. DWORD cLine; // Source line at which the failure took place.
  92. } ERRB, FAR *LPERRB;
  93. #define GetErrCode(lperrb) ((lperrb)->err)
  94. ERR EXPORT_API PASCAL FAR SetErr (LPERRB lperrb, ERR ErrCode, WORD iUserCode);
  95. ERR EXPORT_API CDECL MVSetUserCallback (LPVOID pStruct, PFCALLBACK_MSG pCallback);
  96. ERR EXPORT_API PASCAL FAR DebugSetErr (LPERRB lperrb, ERR ErrCode,
  97. DWORD Line, char FAR *module, WORD iUserCode);
  98. HCE EXPORT_API FAR IssueMessage
  99. (DWORD dwFlag, PFCALLBACK_MSG pCallbackInfo, PERRC perr, HCE hce, ...);
  100. void EXPORT_API FAR IssueString
  101. (PFCALLBACK_MSG pCallback, LPVOID pMessage);
  102. #if defined(_DEBUG)
  103. #define SetErrCode(a,b) DebugSetErr(a, b, __LINE__, (char FAR *)s_aszModule, 0)
  104. #else
  105. #define SetErrCode(a,b) SetErr(a, b, 0)
  106. #endif
  107. #endif // ERRB_DEFINED
  108. /* End of internal usage */
  109. // MAX size of an error string in the resource file.
  110. #define MAX_ERROR_MSG 256
  111. /************************************
  112. * Error Constants
  113. *************************************/
  114. /* General errors */
  115. #ifndef SUCCEED // already defined in sqlfront.h, used by mos
  116. #define SUCCEED 0
  117. #endif
  118. #ifndef FAIL
  119. #define FAIL 1
  120. #endif
  121. #define ERR_NONE 0
  122. #define ERR_SUCCESS 0
  123. #define ERR_OODC 1002 // Out of Display Contexts
  124. #define ERR_NOTITLE 1003
  125. #define ERR_INVALID 1004 // Invalid file
  126. #define ERR_NOTOPIC 1005
  127. #define ERR_BADPRINT 1006
  128. #define ERR_BADFILE 1007
  129. #define ERR_OLDFILE 1008
  130. #define ERR_BUFOVERFLOW 1009
  131. #define ERR_FSREADWRITE 1010
  132. #define ERR_FCENDOFTOPIC 1011
  133. #define ERR_BADPARAM 1012
  134. #define ERR_NOFONTCHANGE 1013
  135. #define ERR_NOMOREHOTSPOTS 1014
  136. #define ERR_BADEWWINCLASS 1015
  137. #define ERR_PARTIAL 1016
  138. #define ERR_NOADDRESS 1017
  139. #define ERR_NORECTANGLE 1018
  140. #define ERR_NOVSCROLL 1019 // No Vertical Scrollbar
  141. #define ERR_NOHSCROLL 1020 // No Horizontal Scrollbar
  142. #define ERR_CANTFINDDLL 1021
  143. #define ERR_CANTUSEDLL 1022
  144. #define ERR_EWOOM 1023 // Embedded Window Out Of Memory
  145. #define ERR_DEBUGMISMATCH 1024
  146. #define ERR_BADPOLYGON 1025 // less than 3 pts or none passed
  147. #define ERR_BADEWCALLBACK 1026
  148. #define ERR_OLDFONTTABLE 1027
  149. #define ERR_NOSUCHSTYLE 1028
  150. #define ERR_GROUPIDTOOBIG 1029
  151. #define ERR_NOMOREHIGHLIGHTS 1030
  152. #define ERR_NOSELECTION 1031
  153. #define ERR_KEYSELECTFAILED 1032 // may need to scroll MV to work.
  154. #define ERR_NOTSCROLLED 1033
  155. #define ERR_NOINDEXLOADED 1034 // search index not loaded
  156. #define ERR_EWCREATEFAILED 1035 // CreateWindow failed.
  157. #define ERR_NOWINDOW 1036 // Window not set in LPMV
  158. #define ERR_OUTOFRANGE 1037
  159. #define ERR_NOTHINGTOCOPY 1038
  160. #define ERR_NOTFOUND 1039
  161. #define ERR_NOTSUPPORTED 1040
  162. #define ERR_RECURSION 1041 // function is currently executing.
  163. #define ERR_XAPARATOOBIG 1042
  164. #define ERR_DUPTITLE 1043 // Duplicate handle in an update list (titleas.c)
  165. #define ERR_INTERNAL_BASE 2000
  166. #define ERR_GRAMMAR_BASE 3000
  167. #define ERR_FAILED (ERR_INTERNAL_BASE + 1)
  168. #define ERR_INTERRUPT (ERR_INTERNAL_BASE + 2)
  169. #define ERR_NEARMEMORY (ERR_INTERNAL_BASE + 3)
  170. #define ERR_MEMORY (ERR_INTERNAL_BASE + 4)
  171. #define ERR_DISKFULL (ERR_INTERNAL_BASE + 5)
  172. #define ERR_WORDTOOLONG (ERR_INTERNAL_BASE + 6)
  173. #define ERR_BADVERSION (ERR_INTERNAL_BASE + 7)
  174. #define ERR_TOOMANYTOPICS (ERR_INTERNAL_BASE + 8)
  175. #define ERR_TOOMANYSTOPS (ERR_INTERNAL_BASE + 9)
  176. #define ERR_TOOLONGSTOPS (ERR_INTERNAL_BASE + 10)
  177. #define ERR_STEMTOOLONG (ERR_INTERNAL_BASE + 11)
  178. #define ERR_TREETOOBIG (ERR_INTERNAL_BASE + 12)
  179. #define ERR_CANTREAD (ERR_INTERNAL_BASE + 13)
  180. #define ERR_IDXSEGOVERFLOW (ERR_INTERNAL_BASE + 14)
  181. #define ERR_BADARG (ERR_INTERNAL_BASE + 15)
  182. #define ERR_VOCABTOOLARGE (ERR_INTERNAL_BASE + 16)
  183. #define ERR_NOTEXIST (ERR_INTERNAL_BASE + 17)
  184. #define ERR_BADOPERATOR (ERR_INTERNAL_BASE + 18)
  185. #define ERR_TERMTOOCOMPLEX (ERR_INTERNAL_BASE + 19)
  186. #define ERR_SEARCHTOOCOMPLEX (ERR_INTERNAL_BASE + 20)
  187. #define ERR_BADSYSCONFIG (ERR_INTERNAL_BASE + 21)
  188. #define ERR_ASSERT (ERR_INTERNAL_BASE + 22)
  189. #define ERR_TOOMANYDUPS (ERR_INTERNAL_BASE + 23)
  190. #define ERR_INVALID_FS_FILE (ERR_INTERNAL_BASE + 24)
  191. #define ERR_OUT_OF_RANGE (ERR_INTERNAL_BASE + 25)
  192. #define ERR_SEEK_FAILED (ERR_INTERNAL_BASE + 26)
  193. #define ERR_FILECREAT_FAILED (ERR_INTERNAL_BASE + 27)
  194. #define ERR_CANTWRITE (ERR_INTERNAL_BASE + 28)
  195. #define ERR_NOHANDLE (ERR_INTERNAL_BASE + 29)
  196. #define ERR_EXIST (ERR_INTERNAL_BASE + 30)
  197. #define ERR_INVALID_HANDLE (ERR_INTERNAL_BASE + 31)
  198. #define ERR_BADFILEFORMAT (ERR_INTERNAL_BASE + 32)
  199. #define ERR_CANTDELETE (ERR_INTERNAL_BASE + 33)
  200. #define ERR_NOPERMISSION (ERR_INTERNAL_BASE + 34)
  201. #define ERR_CLOSEFAILED (ERR_INTERNAL_BASE + 35)
  202. #define ERR_DUPLICATE (ERR_INTERNAL_BASE + 36)
  203. #define ERR_NOMERGEDATA (ERR_INTERNAL_BASE + 37)
  204. #define ERR_TOOMANYTITLES (ERR_INTERNAL_BASE + 38)
  205. #define ERR_BADINDEXFLAGS (ERR_INTERNAL_BASE + 39)
  206. #define ERR_NULLQUERY (ERR_GRAMMAR_BASE + 0)
  207. #define ERR_EXPECTEDTERM (ERR_GRAMMAR_BASE + 1)
  208. #define ERR_EXTRACHARS (ERR_GRAMMAR_BASE + 2)
  209. #define ERR_MISSQUOTE (ERR_GRAMMAR_BASE + 3)
  210. #define ERR_MISSLPAREN (ERR_GRAMMAR_BASE + 4)
  211. #define ERR_MISSRPAREN (ERR_GRAMMAR_BASE + 5)
  212. #define ERR_TOODEEP (ERR_GRAMMAR_BASE + 6)
  213. #define ERR_TOOMANYTOKENS (ERR_GRAMMAR_BASE + 7)
  214. #define ERR_BADFORMAT (ERR_GRAMMAR_BASE + 8)
  215. #define ERR_BADVALUE (ERR_GRAMMAR_BASE + 9)
  216. #define ERR_UNMATCHEDTYPE (ERR_GRAMMAR_BASE + 10)
  217. #define ERR_BADBREAKER (ERR_GRAMMAR_BASE + 11)
  218. #define ERR_BADRANGEOP (ERR_GRAMMAR_BASE + 12)
  219. #define ERR_ALL_WILD (ERR_GRAMMAR_BASE + 13)
  220. #define ERR_NON_LAST_WILD (ERR_GRAMMAR_BASE + 14)
  221. #define ERR_WILD_IN_DTYPE (ERR_GRAMMAR_BASE + 15)
  222. #define ERR_STOPWORD (ERR_GRAMMAR_BASE + 16)
  223. #ifdef __cplusplus
  224. }
  225. #endif