home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Stone / windows / excep0.inc < prev    next >
Text File  |  2000-05-25  |  590b  |  40 lines

  1. comment %
  2.     Abort if Exception include
  3.  
  4.     Use this StructuredExceptionHandler include with care - it's crude
  5.     
  6.  
  7.     2nd&mi!
  8.     stone@one.se
  9.     %
  10.  
  11.  
  12. SetExceptionFrame Macro 
  13.     mov    [OldStack], esp
  14.     pushad
  15.     Call      SetUnhandledExceptionFilter, offset ErrHandler
  16.       mov    [OldFilter], eax
  17.     PopAD
  18. EndM
  19.  
  20. RestoreExceptionFrame Macro
  21.     pushad
  22.     call    SetUnhandledExceptionFilter, [OldFilter]
  23.     popad
  24. EndM
  25.  
  26. .code
  27. ErrHandler Proc
  28.     call    SetUnhandledExceptionFilter, OldFilter
  29.     xor     eax, eax
  30.     mov    esp, [OldStack]
  31.     ret
  32. ErrHandler ENDP
  33.  
  34. .data
  35.     OldFilter    dd 0
  36.     OldStack    dd 0
  37.  
  38.  
  39.  
  40.