The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Player_0 on April 07, 2007, 07:37:35 PM

Title: Finding where SEH was called from
Post by: Player_0 on April 07, 2007, 07:37:35 PM
Hello!
Is there a way to find out the EIP of where an error occurred or to return to the next instruction after an error from within SEH?
Ive been looking around at assembly source for SEH and I cant find anything that mentions this.
I want to setup a single SEH where it will return to the next instruction after an error in a program.
Thanks for any help or suggestions.
Title: Re: Finding where SEH was called from
Post by: zooba on April 08, 2007, 12:36:54 AM
Offset B4h within the CONTEXT structure. For a final handler a pointer to this structure is in [ESP+8], for a per-thread handler the pointer is in [ESP+C]

If all you want to do is return there, set EAX=-1 for a final handler or EAX=0 for a per-thread handler and return.

Cheers,

Zooba