home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / except.inc < prev    next >
Text File  |  1998-06-17  |  3KB  |  86 lines

  1. ;***
  2. ;except.inc - definitions for exception handling
  3. ;
  4. ;       Copyright (c) 1990-1997, Microsoft Corporation. All rights reserved.
  5. ;
  6. ;Purpose:
  7. ;       Structure and constant definitions used by exception handling code.
  8. ;
  9. ;*******************************************************************************
  10.  
  11. ; structure used by SEH support function and intrinsics. the information
  12. ; passed by the OS exception dispatcher is repackaged in this form by the
  13. ; runtime (_except_handler()).
  14.  
  15. __EXCEPTION_INFO_PTRS struc
  16.         preport                 dd      ?
  17.         pcontext                dd      ?
  18. __EXCEPTION_INFO_PTRS ends
  19.  
  20.  
  21. ; exception registration record structure.
  22.  
  23. __EXCEPTIONREGISTRATIONRECORD struc
  24.         prev_structure          dd      ?
  25.         ExceptionHandler        dd      ?
  26.         ExceptionFilter         dd      ?
  27.         FilterFrame             dd      ?
  28.         PExceptionInfoPtrs      dd      ?
  29. __EXCEPTIONREGISTRATIONRECORD ends
  30.  
  31. ; size of exception registration record in double words
  32.  
  33. DWORDS_IN_XREGREC       equ     5
  34.  
  35.  
  36. ; exception report record
  37.  
  38. __EXCEPTIONREPORTRECORD struc
  39.         ExceptionNum            dd      ?
  40.         fHandlerFlags           dd      ?
  41.         ExceptionReportRecord   dd      ?
  42.         ExceptionAddress        dd      ?
  43.         cParameters             dd      ?
  44.         ExceptionInfo           dd      4 dup (?)
  45. __EXCEPTIONREPORTRECORD ends
  46.  
  47.  
  48. ; setjmp/longjmp buffer (i.e., structure underlying jmp_buf array)
  49.  
  50. _JMP_BUF        struc
  51.         ebpsave                 dd      ?
  52.         ebxsave                 dd      ?
  53.         edisave                 dd      ?
  54.         esisave                 dd      ?
  55.         espsave                 dd      ?
  56.         retsave                 dd      ?
  57.         xcptsave                dd      ?
  58. _JMP_BUF        ends
  59.  
  60.  
  61. ; exceptions corresponding to C runtime errors (these are explicitly
  62. ; referenced in the startup code)
  63.  
  64. _XCPT_UNABLE_TO_GROW_STACK      equ             080010001h
  65. _XCPT_INTEGER_DIVIDE_BY_ZERO    equ             0C000009Bh
  66. _XCPT_NONCONTINUABLE_EXCEPTION  equ             0C0000024h
  67. _XCPT_INVALID_DISPOSITION       equ             0C0000025h
  68. _XCPT_SIGABRT                   equ             020000001h
  69.  
  70.  
  71. ; unwind settings in fHandlerFlags
  72.  
  73. _EH_UNWINDING   equ     2
  74. _EH_EXIT_UNWIND equ     4
  75. UNWIND          equ     _EH_UNWINDING OR _EH_EXIT_UNWIND
  76.  
  77.  
  78. ; return values (to the exception dispatcher)
  79.  
  80. IFDEF   _WIN32
  81.  
  82. _XCPT_CONTINUE_SEARCH           equ     000000001h
  83. _XCPT_CONTINUE_EXECUTION        equ     000000000h
  84.  
  85. ENDIF
  86.