Leaked source code of windows server 2003
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.

170 lines
6.4 KiB

  1. #ifndef __ITERROR_H__
  2. #define __ITERROR_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // define the old error types in terms of HRESULTs
  7. typedef HRESULT* PHRESULT;
  8. #define ERR HRESULT
  9. #define ERRB HRESULT
  10. #define LPERRB HRESULT*
  11. #define RC HRESULT
  12. #define SetErrCode(a,b) SetErr(a, b)
  13. #define SetErrReturn(a) SetErr(0, a)
  14. HRESULT PASCAL SetErr (HRESULT* phr, HRESULT ErrCode);
  15. /*************************************************************************
  16. *
  17. * CALLBACK FUNCTIONS PROTOTYPES
  18. *
  19. * User callback functions are needed in case:
  20. * - The application needs to support interrupt
  21. * - The application needs to display error messages its way
  22. * - The application needs to know the status of the process
  23. *************************************************************************/
  24. typedef ERR (FAR PASCAL *ERR_FUNC) (DWORD dwFlag, LPVOID pUserData, LPVOID pMessage);
  25. /*************************************************************************
  26. * Call back structure
  27. * Contains information about all callback functions
  28. *************************************************************************/
  29. #define ERRFLAG_INTERRUPT 0x01 // The processes should be cancelled
  30. #define ERRFLAG_STATUS 0x02 // High-level status messages
  31. #define ERRFLAG_STATUS_VERBOSE 0x04 // Low-level status messages
  32. #define ERRFLAG_ERROR 0x08 // Warning & Error messages
  33. #define ERRFLAG_STRING 0x10 // Debug string messages
  34. typedef struct fCallBack_msg
  35. {
  36. ERR_FUNC MessageFunc;
  37. LPVOID pUserData;
  38. DWORD dwFlags;
  39. } FCALLBACK_MSG, FAR * PFCALLBACK_MSG;
  40. // ***********************************************************************
  41. // This structure should be filled out and passed back in the case of
  42. // an error.
  43. // ***********************************************************************
  44. typedef WORD HCE; // User errors
  45. typedef WORD EP; // Error Phase
  46. typedef struct
  47. {
  48. LPCSTR pchFile;
  49. LONG iLine;
  50. DWORD iTopic;
  51. DWORD fCustom; // If true then var1 is LPCSTR to custom error message
  52. DWORD var1, var2, var3; // Error parameters
  53. EP ep; // Error Phase
  54. HCE errCode;
  55. } ERRC, FAR *PERRC;
  56. #define CALLBACKKEY 0x524A4A44
  57. typedef struct
  58. {
  59. DWORD dwReserved;
  60. DWORD dwKey;
  61. FCALLBACK_MSG Callback;
  62. } CUSTOMSTRUCT, FAR *PCUSTOMSTRUCT;
  63. // Error Phase values
  64. #define epNoFile 0
  65. #define epLine 1
  66. #define epTopic 2
  67. #define epOffset 3
  68. #define epMVBtopic 4
  69. #define epAliasLine 5
  70. #define epByteOffset 6
  71. //
  72. // The InfoTech error codes
  73. //
  74. #define E_NOTEXIST _HRESULT_TYPEDEF_(0x80001000L)
  75. #define E_DUPLICATE _HRESULT_TYPEDEF_(0x80001001L)
  76. #define E_BADVERSION _HRESULT_TYPEDEF_(0x80001002L)
  77. #define E_BADFILE _HRESULT_TYPEDEF_(0x80001003L)
  78. #define E_BADFORMAT _HRESULT_TYPEDEF_(0x80001004L)
  79. #define E_NOPERMISSION _HRESULT_TYPEDEF_(0x80001005L)
  80. #define E_ASSERT _HRESULT_TYPEDEF_(0x80001006L)
  81. #define E_INTERRUPT _HRESULT_TYPEDEF_(0x80001007L)
  82. #define E_NOTSUPPORTED _HRESULT_TYPEDEF_(0x80001008L)
  83. #define E_OUTOFRANGE _HRESULT_TYPEDEF_(0x80001009L)
  84. #define E_GROUPIDTOOBIG _HRESULT_TYPEDEF_(0x8000100AL)
  85. #define E_TOOMANYTITLES _HRESULT_TYPEDEF_(0x8000100BL)
  86. #define E_NOMERGEDDATA _HRESULT_TYPEDEF_(0x8000100CL)
  87. #define E_NOTFOUND _HRESULT_TYPEDEF_(0x8000100DL)
  88. #define E_CANTFINDDLL _HRESULT_TYPEDEF_(0x8000100EL)
  89. #define E_NOHANDLE _HRESULT_TYPEDEF_(0x8000100FL)
  90. #define E_GETLASTERROR _HRESULT_TYPEDEF_(0x80001010L)
  91. #define E_BADPARAM _HRESULT_TYPEDEF_(0x80001011L)
  92. #define E_INVALIDSTATE _HRESULT_TYPEDEF_(0x80001012L)
  93. #define E_NOTOPEN _HRESULT_TYPEDEF_(0x80001013L)
  94. #define E_ALREADYOPEN _HRESULT_TYPEDEF_(0x80001013L)
  95. #define E_UNKNOWN_TRANSPORT _HRESULT_TYPEDEF_(0x80001016L)
  96. #define E_UNSUPPORTED_TRANSPORT _HRESULT_TYPEDEF_(0x80001017L)
  97. #define E_BADFILTERSIZE _HRESULT_TYPEDEF_(0x80001018L)
  98. #define E_TOOMANYOBJECTS _HRESULT_TYPEDEF_(0x80001019L)
  99. #define E_NAMETOOLONG _HRESULT_TYPEDEF_(0x80001020L)
  100. #define E_FILECREATE _HRESULT_TYPEDEF_(0x80001030L)
  101. #define E_FILECLOSE _HRESULT_TYPEDEF_(0x80001031L)
  102. #define E_FILEREAD _HRESULT_TYPEDEF_(0x80001032L)
  103. #define E_FILESEEK _HRESULT_TYPEDEF_(0x80001033L)
  104. #define E_FILEWRITE _HRESULT_TYPEDEF_(0x80001034L)
  105. #define E_FILEDELETE _HRESULT_TYPEDEF_(0x80001035L)
  106. #define E_FILEINVALID _HRESULT_TYPEDEF_(0x80001036L)
  107. #define E_FILENOTFOUND _HRESULT_TYPEDEF_(0x80001037L)
  108. #define E_DISKFULL _HRESULT_TYPEDEF_(0x80001038L)
  109. #define E_TOOMANYTOPICS _HRESULT_TYPEDEF_(0x80001050L)
  110. #define E_TOOMANYDUPS _HRESULT_TYPEDEF_(0x80001051L)
  111. #define E_TREETOOBIG _HRESULT_TYPEDEF_(0x80001052L)
  112. #define E_BADBREAKER _HRESULT_TYPEDEF_(0x80001053L)
  113. #define E_BADVALUE _HRESULT_TYPEDEF_(0x80001054L)
  114. #define E_ALL_WILD _HRESULT_TYPEDEF_(0x80001055L)
  115. #define E_TOODEEP _HRESULT_TYPEDEF_(0x80001056L)
  116. #define E_EXPECTEDTERM _HRESULT_TYPEDEF_(0x80001057L)
  117. #define E_MISSLPAREN _HRESULT_TYPEDEF_(0x80001058L)
  118. #define E_MISSRPAREN _HRESULT_TYPEDEF_(0x80001059L)
  119. #define E_MISSQUOTE _HRESULT_TYPEDEF_(0x8000105AL)
  120. #define E_NULLQUERY _HRESULT_TYPEDEF_(0x8000105BL)
  121. #define E_STOPWORD _HRESULT_TYPEDEF_(0x8000105CL)
  122. #define E_BADRANGEOP _HRESULT_TYPEDEF_(0x8000105DL)
  123. #define E_UNMATCHEDTYPE _HRESULT_TYPEDEF_(0x8000105EL)
  124. #define E_WORDTOOLONG _HRESULT_TYPEDEF_(0x8000105FL)
  125. #define E_BADINDEXFLAGS _HRESULT_TYPEDEF_(0x80001060L)
  126. #define E_WILD_IN_DTYPE _HRESULT_TYPEDEF_(0x80001061L)
  127. #define E_NOSTEMMER _HRESULT_TYPEDEF_(0x80001062L)
  128. // Property list and result set errors
  129. #define E_MISSINGPROP _HRESULT_TYPEDEF_(0x80001080L)
  130. #define E_PROPLISTNOTEMPTY _HRESULT_TYPEDEF_(0x80001081L)
  131. #define E_PROPLISTEMPTY _HRESULT_TYPEDEF_(0x80001082L)
  132. #define E_ALREADYINIT _HRESULT_TYPEDEF_(0x80001083L)
  133. #define E_NOTINIT _HRESULT_TYPEDEF_(0x80001084L)
  134. #define E_RESULTSETEMPTY _HRESULT_TYPEDEF_(0x80001085L)
  135. #define E_TOOMANYCOLUMNS _HRESULT_TYPEDEF_(0x80001086L)
  136. #define E_NOKEYPROP _HRESULT_TYPEDEF_(0x80001087L)
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif // __ITERROR_H__