flat assembler
Message board for the users of flat assembler.

Index > Windows > VEH vs SEH

Author
Thread Post new topic Reply to topic
kas



Joined: 16 Jan 2008
Posts: 36
Location: UK
kas
Hi,

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 Laughing

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,

Kas.
Post 05 Dec 2008, 14:52
View user's profile Send private message Reply with quote
Defsanguje



Joined: 07 Aug 2006
Posts: 7
Location: Finland
Defsanguje
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 Wink
Post 05 Dec 2008, 23:56
View user's profile Send private message MSN Messenger Reply with quote
kas



Joined: 16 Jan 2008
Posts: 36
Location: UK
kas
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.

As regards:
Quote:
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. Wink

Thanks for your advice Defsanguje,

Kas.
Post 06 Dec 2008, 05:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.