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.

159 lines
3.3 KiB

  1. /***
  2. *excpt.h - defines exception values, types and routines
  3. *
  4. * Copyright (c) 1990-2001, 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. * [Public]
  12. *
  13. ****/
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifndef _INC_EXCPT
  18. #define _INC_EXCPT
  19. #if !defined(_WIN32)
  20. #error ERROR: Only Win32 target supported!
  21. #endif
  22. #ifdef _MSC_VER
  23. /*
  24. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  25. * alignment.
  26. */
  27. #pragma pack(push,8)
  28. #endif /* _MSC_VER */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /* Define _CRTIMP */
  33. #ifndef _CRTIMP
  34. #ifdef _DLL
  35. #define _CRTIMP __declspec(dllimport)
  36. #else /* ndef _DLL */
  37. #define _CRTIMP
  38. #endif /* _DLL */
  39. #endif /* _CRTIMP */
  40. /* Define __cdecl for non-Microsoft compilers */
  41. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  42. #define __cdecl
  43. #endif
  44. /*
  45. * Exception disposition return values.
  46. */
  47. typedef enum _EXCEPTION_DISPOSITION {
  48. ExceptionContinueExecution,
  49. ExceptionContinueSearch,
  50. ExceptionNestedException,
  51. ExceptionCollidedUnwind
  52. } EXCEPTION_DISPOSITION;
  53. /*
  54. * Prototype for SEH support function.
  55. */
  56. #ifdef _M_IX86
  57. /*
  58. * Declarations to keep MS C 8 (386/486) compiler happy
  59. */
  60. struct _EXCEPTION_RECORD;
  61. struct _CONTEXT;
  62. EXCEPTION_DISPOSITION __cdecl _except_handler (
  63. struct _EXCEPTION_RECORD *ExceptionRecord,
  64. void * EstablisherFrame,
  65. struct _CONTEXT *ContextRecord,
  66. void * DispatcherContext
  67. );
  68. #elif defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64)
  69. /*
  70. * Declarations to keep MIPS, ALPHA, and PPC compiler happy
  71. */
  72. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  73. struct _EXCEPTION_RECORD;
  74. struct _CONTEXT;
  75. struct _DISPATCHER_CONTEXT;
  76. #if defined(_M_IA64)
  77. _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
  78. struct _EXCEPTION_RECORD *ExceptionRecord,
  79. unsigned __int64 MemoryStackFp,
  80. unsigned __int64 BackingStoreFp,
  81. struct _CONTEXT *ContextRecord,
  82. struct _DISPATCHER_CONTEXT *DispatcherContext,
  83. unsigned __int64 GlobalPointer
  84. );
  85. #else
  86. _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
  87. struct _EXCEPTION_RECORD *ExceptionRecord,
  88. void *EstablisherFrame,
  89. struct _CONTEXT *ContextRecord,
  90. struct _DISPATCHER_CONTEXT *DispatcherContext
  91. );
  92. #endif // defined(_M_IA64)
  93. #endif
  94. /*
  95. * Keywords and intrinsics for SEH
  96. */
  97. #ifdef _MSC_VER
  98. #define GetExceptionCode _exception_code
  99. #define exception_code _exception_code
  100. #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
  101. #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
  102. #define AbnormalTermination _abnormal_termination
  103. #define abnormal_termination _abnormal_termination
  104. unsigned long __cdecl _exception_code(void);
  105. void * __cdecl _exception_info(void);
  106. int __cdecl _abnormal_termination(void);
  107. #endif
  108. /*
  109. * Legal values for expression in except().
  110. */
  111. #define EXCEPTION_EXECUTE_HANDLER 1
  112. #define EXCEPTION_CONTINUE_SEARCH 0
  113. #define EXCEPTION_CONTINUE_EXECUTION -1
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #ifdef _MSC_VER
  118. #pragma pack(pop)
  119. #endif /* _MSC_VER */
  120. #endif /* _INC_EXCPT */