Artifact 4418b56f6e16e7de3d93af5374be8f6b22482ca8:
- Executable file
freshlib/macros/Win32/_exceptions.inc
— part of check-in
[c95846ab5c]
at
2011-04-06 11:18:30
on branch FreshLibDev
— Added unified title comments block to every file in the source tree. The title comments block contains only
information about file purpose, possible dependencies and target OS.
I intentionally removed from title comments all information about people, changes, reference and dates, because this kind of information is imposible to be maintained up to date. This makes it useless or even misleading.
Information about license and development team is added in readme.txt and license.txt files. (user: lhmnai0 size: 1590) [more...]
; _______________________________________________________________________________________ ;| | ;| ..::FreshLib::.. Free, open source. Licensed under "Fresh artistic license." | ;|_______________________________________________________________________________________| ; ; Description: Win32 exception handling macros. ; ; Target OS: Win32 ; ; Dependencies: ; ; Notes: ;_________________________________________________________________________________________ ..TryLevel = 0 macro beginTry { common ptrExceptionContext equ esp+$0c ptrExceptionRecord equ esp+$04 local ..handler, ..endtry end@try equ ..endtry if defined ..handler ..TryLevel = ..TryLevel+1 pushd ..handler pushd [fs:0] mov [fs:0], esp end if macro onException \{ jmp ..endtry ..handler: \} macro Ignore \{ mov eax, [ptrExceptionContext] mov [eax+CONTEXT.regEip], ..endtry xor eax, eax retn \} macro Retry \{ xor eax, eax retn \} macro Next \{ mov eax, 1 retn \} } macro endTry { common label end@try if ..TryLevel > 0 popd [fs:0] add esp, 4 ..TryLevel = ..TryLevel - 1 end if purge onException purge Ignore purge Next purge Retry restore end@try restore ptrExceptionContext restore ptrExceptionRecord }