If you've been reading this subforum you're probably aware of the changed exception model in x64 versions of Windows.
Unfortunately there seems to be virtually no information on how to use it with MASM.
Any pointers to more information or even working examples would be greatly appreciated :)
Hi tofu-sensei, I already saw your "amd64" macros and you really seem to know something about it. Or they don't work? ;)
As far as I can tell they're working fine :wink
Unfortunately I have no idea how to implement, say, the equivalent of a try-catch-block or a stack-unwinding mechanism.
I'm not sure whether this helps you or not
see the directory
IgnoreExceptions
http://fdbg.x86asm.net/fdbg0015_samples.zip
it has some ideas how to debug exception handler
and the executable in
http://beatrix2004.free.fr/BeaBA/BeaBA.rar
seems to have Exception Directory of a PE32+
and some reading
http://66.102.9.104/search?q=cache:ycabCQnoeFoJ:www.osronline.com/article.cfm%3Farticle%3D469+exception+directory&hl=cs&ct=clnk&cd=7&gl=cz
The sample programs seem to deal with vectored exception handling - not quite what I was looking for.
I also found the article you linked to, unfortunately it lacks any non-C examples.
The structures containing the unwind information are pretty well documented on MSDN. The only "example" on exception handling I found (here (http://msdn2.microsoft.com/en-us/library/5btab6c7(VS.80).aspx)) was this
The following sample shows how to specify an unwind/exception handler:
; ml64 ex3.asm /link /entry:Example1 /SUBSYSTEM:Console
text SEGMENT
PUBLIC Example3
PUBLIC Example3_UW
Example3_UW PROC NEAR
; exception/unwind handler body
ret 0
Example3_UW ENDP
Example3 PROC FRAME : Example3_UW
sub rsp, 16
.allocstack 16
.endprolog
; function body
add rsp, 16
ret 0
Example3 ENDP
text ENDS
END
which is not that helpful.
Hi
Attached you can find the SEH file I used for the ObjAsm32 project. There you can find how to use it, if you can not figure it out how to use it.
VEH adds more functionality to SEH and supersedes it using the proper APIs. Unfortunately, it is not available for older OSs.
Regards,
Biterider
[attachment deleted by admin]
No offence, but this thread is about 64-bit exception handling :wink
Hooray, I got some rudimentary exception handling to work :P
Will post some example code soon.