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.

150 lines
3.1 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_IA64)
  69. /*
  70. * Declarations to keep IA64 compiler happy
  71. */
  72. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  73. struct _EXCEPTION_RECORD;
  74. struct _CONTEXT;
  75. struct _DISPATCHER_CONTEXT;
  76. _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
  77. struct _EXCEPTION_RECORD *ExceptionRecord,
  78. unsigned __int64 MemoryStackFp,
  79. unsigned __int64 BackingStoreFp,
  80. struct _CONTEXT *ContextRecord,
  81. struct _DISPATCHER_CONTEXT *DispatcherContext,
  82. unsigned __int64 GlobalPointer
  83. );
  84. #endif
  85. /*
  86. * Keywords and intrinsics for SEH
  87. */
  88. #ifdef _MSC_VER
  89. #define GetExceptionCode _exception_code
  90. #define exception_code _exception_code
  91. #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
  92. #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
  93. #define AbnormalTermination _abnormal_termination
  94. #define abnormal_termination _abnormal_termination
  95. unsigned long __cdecl _exception_code(void);
  96. void * __cdecl _exception_info(void);
  97. int __cdecl _abnormal_termination(void);
  98. #endif
  99. /*
  100. * Legal values for expression in except().
  101. */
  102. #define EXCEPTION_EXECUTE_HANDLER 1
  103. #define EXCEPTION_CONTINUE_SEARCH 0
  104. #define EXCEPTION_CONTINUE_EXECUTION -1
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #ifdef _MSC_VER
  109. #pragma pack(pop)
  110. #endif /* _MSC_VER */
  111. #endif /* _INC_EXCPT */