home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / excpt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  3.8 KB  |  191 lines

  1. /***
  2. *excpt.h - defines exception values, types and routines
  3. *
  4. *    Copyright (c) 1990-1997, 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.  
  13. #ifndef _INC_EXCPT
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #ifdef UNDER_CE
  20.  
  21. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  22.  
  23. #ifndef _CRTAPI1
  24. #if    ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  25. #define _CRTAPI1 __cdecl
  26. #else
  27. #define _CRTAPI1
  28. #endif
  29. #endif
  30.  
  31.  
  32. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  33.  
  34. #ifndef _CRTAPI2
  35. #if    ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  36. #define _CRTAPI2 __cdecl
  37. #else
  38. #define _CRTAPI2
  39. #endif
  40. #endif
  41.  
  42.  
  43. /* Define _CRTIMP */
  44.  
  45. #ifndef _CRTIMP
  46. #ifdef    _NTSDK
  47. /* definition compatible with NT SDK */
  48. #define _CRTIMP
  49. #else    /* ndef _NTSDK */
  50. /* current definition */
  51. #ifdef    _DLL
  52. #define _CRTIMP __declspec(dllimport)
  53. #else    /* ndef _DLL */
  54. #define _CRTIMP
  55. #endif    /* _DLL */
  56. #endif    /* _NTSDK */
  57. #endif    /* _CRTIMP */
  58.  
  59.  
  60. /* Define __cdecl for non-Microsoft compilers */
  61.  
  62. #if    ( !defined(_MSC_VER) && !defined(__cdecl) )
  63. #define __cdecl
  64. #endif
  65.  
  66. #endif      /* UNDER_CE */
  67.  
  68.  
  69. /*
  70.  * Exception disposition return values.
  71.  */
  72. typedef enum _EXCEPTION_DISPOSITION {
  73.     ExceptionContinueExecution,
  74.     ExceptionContinueSearch,
  75.     ExceptionNestedException,
  76.     ExceptionCollidedUnwind
  77.  
  78. #ifdef UNDER_CE
  79.     ,
  80.     ExceptionExecuteHandler
  81. #endif
  82.  
  83. } EXCEPTION_DISPOSITION;
  84.  
  85.  
  86. /*
  87.  * Prototype for SEH support function.
  88.  */
  89.  
  90. #ifdef UNDER_CE
  91.  
  92. /*
  93.  * Declarations to keep MIPS and ALPHA compiler happy
  94.  */
  95. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  96. struct _EXCEPTION_RECORD;
  97. struct _CONTEXT;
  98. struct _RUNTIME_FUNCTION;
  99. struct _EXCEPTION_REGISTRATION_RECORD;
  100.  
  101. typedef struct _DISPATCHER_CONTEXT {
  102. #if x86
  103.     struct _EXCEPTION_REGISTRATION_RECORD *RegistrationPointer;
  104.     ULONG ControlPc;
  105. #else
  106.     ULONG ControlPc;
  107.     struct _RUNTIME_FUNCTION *FunctionEntry;
  108.     ULONG EstablisherFrame;
  109.     PCONTEXT ContextRecord;
  110. #endif
  111. } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
  112.  
  113. typedef EXCEPTION_DISPOSITION EXCEPTION_ROUTINE (
  114.     struct _EXCEPTION_RECORD *ExceptionRecord,
  115.     void *EstablisherFrame,
  116.     struct _CONTEXT *ContextRecord,
  117.     struct _DISPATCHER_CONTEXT *DispatcherContext
  118.     );
  119. typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;
  120.  
  121. #if x86
  122. EXCEPTION_ROUTINE _except_handler3;
  123. #else
  124. EXCEPTION_ROUTINE __C_specific_handler;
  125. #endif
  126.  
  127. #else
  128.  
  129. #ifdef    _M_IX86
  130.  
  131. /*
  132.  * Declarations to keep MS C 8 (386/486) compiler happy
  133.  */
  134. struct _EXCEPTION_RECORD;
  135. struct _CONTEXT;
  136.  
  137. EXCEPTION_DISPOSITION __cdecl _except_handler (
  138.     struct _EXCEPTION_RECORD *ExceptionRecord,
  139.     void * EstablisherFrame,
  140.     struct _CONTEXT *ContextRecord,
  141.     void * DispatcherContext
  142.     );
  143.  
  144. #endif
  145. #endif    /* UNDER_CE */
  146.  
  147.  
  148. /*
  149.  * Keywords and intrinsics for SEH
  150.  */
  151.  
  152. #ifdef    _MSC_VER
  153.  
  154. #if    !defined(__cplusplus)
  155. #define try                __try
  156. #define except                __except
  157. #define finally             __finally
  158. #define leave                __leave
  159. #endif
  160.  
  161. #define GetExceptionCode        _exception_code
  162. #define exception_code            _exception_code
  163. #define GetExceptionInformation     (struct _EXCEPTION_POINTERS *)_exception_info
  164. #define exception_info            (struct _EXCEPTION_POINTERS *)_exception_info
  165. #define AbnormalTermination        _abnormal_termination
  166. #define abnormal_termination        _abnormal_termination
  167.  
  168. unsigned long __cdecl _exception_code(void);
  169. void *          __cdecl _exception_info(void);
  170. int          __cdecl _abnormal_termination(void);
  171.  
  172. #endif
  173.  
  174.  
  175. /*
  176.  * Legal values for expression in except().
  177.  */
  178.  
  179. #define EXCEPTION_EXECUTE_HANDLER     1
  180. #define EXCEPTION_CONTINUE_SEARCH     0
  181. #define EXCEPTION_CONTINUE_EXECUTION    -1
  182.  
  183.  
  184.  
  185. #ifdef __cplusplus
  186. }
  187. #endif
  188.  
  189. #define _INC_EXCPT
  190. #endif    /* _INC_EXCPT */
  191.