Message board for the users of flat assembler.
> Windows > VEH vs SEH
kas 05 Dec 2008, 14:52
I've been trying to get a variety of exception handling routines to work on win32... with mixed success. Well I was deep into the SEH when I came across mention of VEH!
After more research (msdn, wikipedia, google)... i've found that:
a) VEH was introduced into APIs later,
b) VEH does not replace SEH but instead -they are supposed to work together,
c) VEH is in principle simpler to work with.
Option (c) in particular appeals
So I ask... can anyone put in nutshell... some very general rule when to use SEH - when to use VEH - and why?
Thanks for any light on this,
|05 Dec 2008, 14:52||
Defsanguje 05 Dec 2008, 23:56
Vectored exception handler catches all the exceptions that are thrown in the process, whereas SEH catches only exceptions of the thread where it's installed. If both exists, vectored exception handler(s) are called first and SEH after them. I'd recommend you to use SEH because it's usually enough and won't lead to spaghetti code even in multi-threaded programs. Depends on what you're doing, of course... And SEH isn't that complex, have a look at "SEH/Hardware Breakpoint in Win32" on examples page
|05 Dec 2008, 23:56||
kas 06 Dec 2008, 05:20
Ok, so, (to put it in my own words) - you're saying that:
- vectored exception handling is best for catching problems of an application-wide nature but easily leads to spagetti code and that,
- structured exeption handling is best for the of managing most exception circumstances (though not all?) and is especially good with threads.
I hope I understood correctly.
have a look at "SEH/Hardware Breakpoint in Win32"
that code... and the Jeremy Gordon article at Iczelions... were the examples I'd been getting to grips with (just !). But after that experience I was hoping, when I came across mention of a newer simpler VEH approach, that there might be some way to slash out a ton of the boilerplate code/overhead that's needed for SEH to work ok.
Obviously though, from your advice and more research I've done on line - it seems VEH isn't the 'delete key' I was looking for.
Thanks for your advice Defsanguje,
|06 Dec 2008, 05:20||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.