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

  1. ;***
  2. ;exsup.inc
  3. ;
  4. ;       Copyright (C) 1993-1997, Microsoft Corporation. All rights reserved.
  5. ;
  6. ;Purpose:
  7. ;       Common data structures & definitions for exsup.asm and other
  8. ;       Structured Exception Handling support modules.
  9. ;
  10. ;******************************************************************************
  11.  
  12.  
  13. ;handler dispositions
  14. DISPOSITION_DISMISS             equ     0
  15. DISPOSITION_CONTINUE_SEARCH     equ     1
  16. DISPOSITION_NESTED_EXCEPTION    equ     2
  17. DISPOSITION_COLLIDED_UNWIND     equ     3
  18.  
  19. ;filter return codes
  20. FILTER_ACCEPT           equ     1
  21. FILTER_DISMISS          equ     -1
  22. FILTER_CONTINUE_SEARCH  equ     0
  23.  
  24. ;handler flags settings..
  25. EXCEPTION_UNWINDING     equ     2
  26. EXCEPTION_EXIT_UNWIND   equ     4
  27. EXCEPTION_UNWIND_CONTEXT equ    EXCEPTION_UNWINDING OR EXCEPTION_EXIT_UNWIND
  28.  
  29. TRYLEVEL_NONE           equ     -1
  30. TRYLEVEL_INVALID        equ     -2
  31.  
  32. ;callback interface codes (mimimal required set)
  33. CB_GET_MAX_CODE         equ     0
  34. CB_DO_LOCAL_UNWIND      equ     1
  35. CB_GET_FRAME_EBP        equ     2
  36. CB_GET_SCOPE_INDEX      equ     3
  37. CB_GET_SCOPE_DATA       equ     4
  38. MAX_CALLBACK_CODE       equ     4
  39.  
  40. ;typedef struct _EXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION;
  41. ;struct _EXCEPTION_REGISTRATION{
  42. ;     struct _EXCEPTION_REGISTRATION *prev;
  43. ;     void (*handler)(PEXCEPTION_RECORD, PEXCEPTION_REGISTRATION, PCONTEXT, PEXCEPTION_RECORD);
  44. ;     struct scopetable_entry *scopetable;
  45. ;     int trylevel;
  46. ;     int _ebp;
  47. ;     PEXCEPTION_POINTERS xpointers;
  48. ;};
  49. _EXCEPTION_REGISTRATION struc
  50.     prev                dd      ?
  51.     handler             dd      ?
  52. _EXCEPTION_REGISTRATION ends
  53.  
  54. ;setjmp/longjmp buffer
  55. _JMP_BUF struc
  56.     saved_ebp           dd      ?
  57.     saved_ebx           dd      ?
  58.     saved_edi           dd      ?
  59.     saved_esi           dd      ?
  60.     saved_esp           dd      ?
  61.     saved_return        dd      ?
  62.     saved_xregistration dd      ?
  63.     saved_trylevel      dd      ?
  64.     ; following only found in C9.0 or later jmp_buf
  65.     version_cookie      dd      ?
  66.     unwind_func         dd      ?
  67.     unwind_data         dd      6 dup(?)
  68. _JMP_BUF ends
  69.  
  70. ; Cookie placed in the jmp_buf to identify the new, longer form
  71. JMPBUF_COOKIE   equ     'VC20'
  72.  
  73. ; Offset of TryLevel in a C8.0 SEH registration node
  74. C8_TRYLEVEL     equ     12
  75.  
  76. ; NLG struct (debugging info)
  77. ;
  78. ; struct {
  79. ;    unsigned long   dwSig;
  80. ;    unsigned long   uoffDestination;
  81. ;    unsigned long   dwCode;
  82. ;    unsigned long   uoffFramePointer;
  83. ; } _NLG_Destination = {EH_MAGIC_NUMBER1,0,0,0};
  84.  
  85. MAGIC_NUMBER1           equ     019930520h
  86.  
  87. _NLG_INFO struc
  88.     dwSig                       dd      MAGIC_NUMBER1
  89.     uoffDestination     dd      0
  90.     dwCode                      dd      0
  91.     uoffFramePointer    dd      0
  92. _NLG_INFO ends
  93.  
  94. ; This constant is also defined in mtdll.h!
  95. _NLG_LOCK               equ     01ah
  96.