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.

149 lines
3.2 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. struct _EXCEPTION_RECORD;
  57. struct _CONTEXT;
  58. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  59. struct _DISPATCHER_CONTEXT;
  60. #ifdef _M_IX86
  61. EXCEPTION_DISPOSITION __cdecl _except_handler (
  62. struct _EXCEPTION_RECORD *ExceptionRecord,
  63. void * EstablisherFrame,
  64. struct _CONTEXT *ContextRecord,
  65. void * DispatcherContext
  66. );
  67. #elif defined(_M_IA64)
  68. _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
  69. struct _EXCEPTION_RECORD *ExceptionRecord,
  70. unsigned __int64 MemoryStackFp,
  71. unsigned __int64 BackingStoreFp,
  72. struct _CONTEXT *ContextRecord,
  73. struct _DISPATCHER_CONTEXT *DispatcherContext,
  74. unsigned __int64 GlobalPointer
  75. );
  76. #elif defined(_M_AMD64)
  77. _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
  78. struct _EXCEPTION_RECORD *ExceptionRecord,
  79. void *EstablisherFrame,
  80. struct _CONTEXT *ContextRecord,
  81. struct _DISPATCHER_CONTEXT *DispatcherContext
  82. );
  83. #endif
  84. /*
  85. * Keywords and intrinsics for SEH
  86. */
  87. #ifdef _MSC_VER
  88. #define GetExceptionCode _exception_code
  89. #define exception_code _exception_code
  90. #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
  91. #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
  92. #define AbnormalTermination _abnormal_termination
  93. #define abnormal_termination _abnormal_termination
  94. unsigned long __cdecl _exception_code(void);
  95. void * __cdecl _exception_info(void);
  96. int __cdecl _abnormal_termination(void);
  97. #endif
  98. /*
  99. * Legal values for expression in except().
  100. */
  101. #define EXCEPTION_EXECUTE_HANDLER 1
  102. #define EXCEPTION_CONTINUE_SEARCH 0
  103. #define EXCEPTION_CONTINUE_EXECUTION -1
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #ifdef _MSC_VER
  108. #pragma pack(pop)
  109. #endif /* _MSC_VER */
  110. #endif /* _INC_EXCPT */