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.

158 lines
3.1 KiB

  1. /***
  2. *excpt.h - defines exception values, types and routines
  3. *
  4. * Copyright (c) 1990-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains the definitions and prototypes for the compiler-
  8. * dependent intrinsics, support functions and keywords which implement
  9. * the structured exception handling extensions.
  10. *
  11. ****/
  12. #ifndef _INC_EXCPT
  13. #define _INC_EXCPT
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  18. #ifndef _CRTAPI1
  19. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  20. #define _CRTAPI1 __cdecl
  21. #else
  22. #define _CRTAPI1
  23. #endif
  24. #endif
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  28. #define _CRTAPI2 __cdecl
  29. #else
  30. #define _CRTAPI2
  31. #endif
  32. #endif
  33. /* Define _CRTIMP */
  34. #ifndef _CRTIMP
  35. #ifdef _NTSDK
  36. /* definition compatible with NT SDK */
  37. #define _CRTIMP
  38. #else /* ndef _NTSDK */
  39. /* current definition */
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _NTSDK */
  46. #endif /* _CRTIMP */
  47. /* Define __cdecl for non-Microsoft compilers */
  48. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  49. #define __cdecl
  50. #endif
  51. /*
  52. * Exception disposition return values.
  53. */
  54. typedef enum _EXCEPTION_DISPOSITION {
  55. ExceptionContinueExecution,
  56. ExceptionContinueSearch,
  57. ExceptionNestedException,
  58. ExceptionCollidedUnwind
  59. } EXCEPTION_DISPOSITION;
  60. /*
  61. * Prototype for SEH support function.
  62. */
  63. #ifdef _M_IX86
  64. /*
  65. * Declarations to keep MS C 8 (386/486) compiler happy
  66. */
  67. struct _EXCEPTION_RECORD;
  68. struct _CONTEXT;
  69. EXCEPTION_DISPOSITION __cdecl _except_handler (
  70. struct _EXCEPTION_RECORD *ExceptionRecord,
  71. void * EstablisherFrame,
  72. struct _CONTEXT *ContextRecord,
  73. void * DispatcherContext
  74. );
  75. #elif defined(_M_MRX000) || defined(_M_ALPHA)
  76. /*
  77. * Declarations to keep MIPS and ALPHA compiler happy
  78. */
  79. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  80. struct _EXCEPTION_RECORD;
  81. struct _CONTEXT;
  82. struct _DISPATCHER_CONTEXT;
  83. EXCEPTION_DISPOSITION __C_specific_handler (
  84. struct _EXCEPTION_RECORD *ExceptionRecord,
  85. void *EstablisherFrame,
  86. struct _CONTEXT *ContextRecord,
  87. struct _DISPATCHER_CONTEXT *DispatcherContext
  88. );
  89. #endif
  90. /*
  91. * Keywords and intrinsics for SEH
  92. */
  93. #ifdef _MSC_VER
  94. #if defined(_NTSDK) && !defined(__cplusplus)
  95. #define try __try
  96. #define except __except
  97. #define finally __finally
  98. #define leave __leave
  99. #endif /* _NTSDK */
  100. #define GetExceptionCode _exception_code
  101. #define exception_code _exception_code
  102. #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
  103. #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
  104. #define AbnormalTermination _abnormal_termination
  105. #define abnormal_termination _abnormal_termination
  106. unsigned long __cdecl _exception_code(void);
  107. void * __cdecl _exception_info(void);
  108. int __cdecl _abnormal_termination(void);
  109. #endif
  110. /*
  111. * Legal values for expression in except().
  112. */
  113. #define EXCEPTION_EXECUTE_HANDLER 1
  114. #define EXCEPTION_CONTINUE_SEARCH 0
  115. #define EXCEPTION_CONTINUE_EXECUTION -1
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif /* _INC_EXCPT */