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.

139 lines
3.8 KiB

  1. /***
  2. *except.h - defines exception values, types and routines
  3. *
  4. * Copyright (c) 1990-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines the exception values, types and declares the
  8. * associated functions.
  9. *
  10. ****/
  11. #ifndef _INC_EXCEPT
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #if (_MSC_VER <= 600)
  16. #define __cdecl _cdecl
  17. #endif
  18. /*
  19. * exception codes defined by the host OS
  20. *
  21. * NOTE: THE UNDERSCORE PREFIX IN THE FOLLOWING NAMES WAS ADDED TO CONFORM
  22. * WITH ANSI NAMESPACE REQUIREMENTS.
  23. */
  24. #define _XCPT_GUARD_PAGE_VIOLATION 0x80000001
  25. #define _XCPT_UNABLE_TO_GROW_STACK 0x80010001
  26. #define _XCPT_DATATYPE_MISALIGNMENT 0xC000009E
  27. #define _XCPT_BREAKPOINT 0xC000009F
  28. #define _XCPT_SINGLESTEP 0xC00000A0
  29. #define _XCPT_ACCESS_VIOLATION 0xC0000005
  30. #define _XCPT_ILLEGAL_INSTRUCTION 0xC000001C
  31. #define _XCPT_FLOATING_DENORMAL_OPERAND 0xC0000094
  32. #define _XCPT_FLOATING_DIVIDE_BY_ZERO 0xC0000095
  33. #define _XCPT_FLOATING_INEXACT_RESULT 0xC0000096
  34. #define _XCPT_FLOATING_INVALID_OPERATION 0xC0000097
  35. #define _XCPT_FLOATING_OVERFLOW 0xC0000098
  36. #define _XCPT_FLOATING_STACK_CHECK 0xC0000099
  37. #define _XCPT_FLOATING_UNDERFLOW 0xC000009A
  38. #define _XCPT_INTEGER_DIVIDE_BY_ZERO 0xC000009B
  39. #define _XCPT_INTEGER_OVERFLOW 0xC000009C
  40. #define _XCPT_PRIVILEGED_INSTRUCTION 0xC000009D
  41. #define _XCPT_IN_PAGE_ERROR 0xC0000006
  42. #define _XCPT_PROCESS_TERMINATE 0xC0010001
  43. #define _XCPT_ASYNC_PROCESS_TERMINATE 0xC0010002
  44. #define _XCPT_NONCONTINUABLE_EXCEPTION 0xC0000024
  45. #define _XCPT_INVALID_DISPOSITION 0xC0000025
  46. #define _XCPT_INVALID_LOCK_SEQUENCE 0xC000001D
  47. #define _XCPT_ARRAY_BOUNDS_EXCEEDED 0xC0000093
  48. #define _XCPT_B1NPX_ERRATA_02 0xC0010004
  49. #define _XCPT_UNWIND 0xC0000026
  50. #define _XCPT_BAD_STACK 0xC0000027
  51. #define _XCPT_INVALID_UNWIND_TARGET 0xC0000028
  52. #define _XCPT_SIGNAL 0xC0010003
  53. /*
  54. * exception codes defined by the C runtime
  55. */
  56. #define _XCPT_SIGABRT 0x20000001
  57. #define _XCPT_SIGUSR1 0x20000002
  58. #define _XCPT_SIGUSR2 0x20000003
  59. #define _XCPT_SIGUSR3 0x20000004
  60. #define _XCPT_FLOATING_EXPLICITGEN 0x20000005
  61. /*
  62. * constants, structs and types used in exception handling at the OS level
  63. *
  64. * NOTE: MANY OF IDENTIFIERS DEFINED BELOW ARE FROM DCR 1024. HOWEVER, THEY
  65. * HAVE BEEN CHANGED TO CONFORM WITH ANSI NAMESPACE RESTRICTIONS.
  66. */
  67. #define _EXCEPTION_MAXIMUM_PARAMETERS 4
  68. struct __EXCEPTIONREPORTRECORD {
  69. unsigned long ExceptionNum;
  70. unsigned long fHandlerFlags;
  71. struct __EXCEPTIONREPORTRECORD * NestedExceptionReportRecord;
  72. void * ExceptionAddress;
  73. unsigned long cParameters;
  74. unsigned long ExceptionInfo[_EXCEPTION_MAXIMUM_PARAMETERS];
  75. };
  76. typedef struct __EXCEPTIONREPORTRECORD _EXCEPTIONREPORTRECORD;
  77. typedef struct __EXCEPTIONREPORTRECORD * _PEXCEPTIONREPORTRECORD;
  78. /*
  79. * values of ExceptionInfo[0] for _XCPT_SIGNAL.
  80. */
  81. #define _XCPT_SIGNAL_INTR 1 /* corresponds to SIGINT */
  82. #define _XCPT_SIGNAL_KILLPROC 3 /* corresponds to SIGTERM */
  83. #define _XCPT_SIGNAL_BREAK 4 /* corresponds to SIGBREAK */
  84. /*
  85. * NOTE: THE FOLLOWING DEFINITION FOR _PCONTEXTRECORD IS INCORRECT, BUT I
  86. * DON'T ACTUALLY USE IT FOR ANYTHING AND REAL DEFINITION WOULD TAKE A GOOD
  87. * TWO PAGES. SEE PAGES 16 AND 17 OF VOL1.TXT FOR THE CORRECT DEFINITION.
  88. */
  89. typedef void * _PCONTEXTRECORD;
  90. /*
  91. * structure used by SEH support function and intrinsics. the information
  92. * passed by the exception dispatcher is repackaged in this form by the
  93. * runtime (_except_handler()).
  94. */
  95. struct __EXCEPTION_INFO_PTRS {
  96. _PEXCEPTIONREPORTRECORD preport;
  97. _PCONTEXTRECORD pcontext;
  98. };
  99. typedef struct __EXCEPTION_INFO_PTRS * _PEXCEPTION_INFO_PTRS;
  100. #ifndef _MAC_
  101. /*
  102. * prototypes for intrinsic SEH functions
  103. */
  104. unsigned long __cdecl _exception_code(void);
  105. void * __cdecl _exception_info(void);
  106. int __cdecl _abnormal_termination(void);
  107. #endif /* ndef _MAC_ */
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #define _INC_EXCEPT
  112. #endif /* _INC_EXCEPT */