Questions tagged [seh]

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

177 questions
0
votes
1 answer

Get description from ExceptionCode

Is there an API for translating ExceptionCode:s in an ExceptionRecord to a readable message like FormatMessage for regular errors.
user877329
  • 6,717
  • 8
  • 46
  • 88
0
votes
1 answer

Handling access violations through SEH

I've created a memory manager that allocates memory surrounded by two pages with protection PAGE_NOACCESS. I call a function that uses this memory in a SEH block, and I catch ACCESS_VIOLATION exceptions (if any) that happens in this block. Now, in…
Shaggi
  • 1,121
  • 1
  • 9
  • 31
0
votes
1 answer

Using Windows SEH and GCC label-as-value to jump to local error handler

I need to unit test some code where the failure cases raise an exception. In a nutshell, I need to handle the exception by either unwinding a stack frame or making a local jump over the error. Using MSVC is not an option. The MSDN example for…
gibbss
  • 2,013
  • 1
  • 15
  • 22
0
votes
1 answer

How to use int3( VEH or SEH )

Know I want to replace function prologue with jmp to jump to my allocate zone(VirtualAllocateEx). But function prologue just have 3 bytes, and jmp have 5 bytes. like this: 55 `push ebp` 8B EC `mov ebp, esp` 833D…
user1021319
  • 117
  • 1
  • 1
  • 6
-1
votes
1 answer

Visual studio "module unsafe for SAFESEH image" occurring when building release in Assembly/C++

I've been following this youtube tutorial to begin learning about Assembly: https://www.youtube.com/watch?v=W3roB5sRg4o&list=PLRwVmtr-pp05c1HTBj1no6Fl6C6mlxYDG&index=2 And everything's been going fine until I switch the build from debug to release,…
paxous
  • 119
  • 10
-1
votes
3 answers

Datatype misalignment exception win32 example

Can someone show a simple example on c++, which will cause datatype misalignment exception? I want to see an example without using RaiseException function.
spartaneg
  • 329
  • 2
  • 12
-1
votes
2 answers

how post mortem debugger catch even what unhandled exception filter missed

i'm trying to impl some post mortem debugger , means to catch only exception who not handled by the program, so i'm sets unhandled exception filter (and make sure no one set it after me) but i have some cases (e.g in mshtml.dll) that access…
-1
votes
1 answer

How do I stop a process-killing exception in a DLL?

My C++ application is using a 3rd party DLL that provides an API to some external software. There are no other options here. This is the software, API, and DLL that I must use. I am trying to bomb-proof my interface. When an API call goes bad,…
user2705346
  • 19
  • 1
  • 4
-1
votes
1 answer

How to get the benefits of /EHa with /EHsc, on a particular function?

If I know that a particular extern "C" function in my program (say, RaiseException) is the only function that raises SEH exceptions, and I want them converted to C++ exceptions, is there any way for me to "selectively enable" /EHa for that function,…
user541686
  • 205,094
  • 128
  • 528
  • 886
-2
votes
1 answer

How to solve access violation reading location in google test?

I am trying to run Google test with the below code. I am reading some memory location for register value with code similar to the examples below. Header file : typedef union MYREG { uint32_t u32reg; uint8_t au8byte[4]; } MYREG_t; #define…
user2986042
  • 1,098
  • 2
  • 16
  • 37
-2
votes
1 answer

Should I register an SEH handler and catch CPU exceptions in my library?

I am having a custom exception class for my library. I would like to know whether I should register an SEH handler and catch CPU exceptions such as access violation, illegal instruction, divide by zero. I then can report these to the client of my…
YBB
  • 1
-3
votes
1 answer

How to handle SEH exception on a global level

I wanted to catch SEH exception globally i.e. if a SEH exception occurs in a thread of an object of ClassB called in ClassA, is it possible to catch the SEH exception in Main (ClassA instance is called in Main)? I have been using…
Batmon
  • 21
  • 5
1 2 3
11
12