Code:
@SEH_SetupFrame <jmp __exit_seh_fja>
....
__exit_seh_fja: @SEH_RemoveFrame
<oslobodi alocirane resurse ili izađi iz niti/programa>
Code:
; The following macroz "@SEH_SetupFrame" and "@SEH_RemoveFrame" are limited
; assembler versionz of the _try and _except keywordz used in C language.
; They provide fast and powerful "Structured Exception Handling" support
; for Win32 applicationz in a few linez of code. Though Microsoft seems
; intent on hiding the details of OS-level structured exception handling,
; this code relies on documented featurez of the Win32 API implementation
; and as such it works in both Windoze 95 and Windoze NT.
@SEH_SetupFrame macro ExceptionHandler
local set_new_eh
call set_new_eh
mov esp,[esp.EH_EstablisherFrame]
ExceptionHandler
set_new_eh: xor edx,edx ; Setup new SEH frame
push dword ptr fs:[edx]
mov fs:[edx],esp
endm
; The ExceptionHandler argument in the @SEH_SetupFrame macro definition
; can be a single instruction or another macro containing several of them.
@SEH_RemoveFrame macro
xor edx,edx ; Remove new SEH frame and set old
pop dword ptr fs:[edx]
pop edx
endm
z0mbie koristi samo tasm32 + bcc32, zar ti treba ijedan drugi argument? :)
I u TASM-u imaš invoke (iako možeš i sa call slati parametre):
Code:
invoke macro api
extrn api:proc
call api
endm