I am trying to use __try/__except to catch crashes that may occur in my driver.
It works great for NULL pointer access, but not for a plain bad memory access.
If the driver accesses 0xfefefefe (just as a test!), I see a crash in
WinDbg, instead of my exception handler getting launched.
The crash is below. How do I catch it (and other exceptions) ?
PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced. This cannot be protected by try-except,
it must be protected by a Probe. Typically the address is just plain bad or
it
is pointing at freed memory.
Arguments:
Arg1: fefefefe, memory referenced.
Arg2: 00000000, value 0 = read operation, 1 = write operation.
Arg3: b94ca75d, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, (reserved)
/ Hannes.