Reputation:
I want to inject a DLL into a process. Once this DLL is in there, it should catch & properly handle all access violation exceptions which occur in the process. Is there any way to accomplish this?
Upvotes: 1
Views: 1330
Reputation: 54604
Pre XP, you cannot catch all exceptions. XP or later, you should use AddVectoredExceptionHandler(1, handler)
, although you are not guaranteed that you will always be the first vectored exception handler.
Upvotes: 0
Reputation: 5769
To complete the collection, you can also use AddVectoredExceptionHandler.
Upvotes: 0
Reputation: 2996
How about SetUnhandledExceptionFilter( function )?
function's prototype is:
LONG __stdcall ExceptionHandler(EXCEPTION_POINTERS *ExceptionInfo);
I've used this function to create crash dumps, etc.
Upvotes: 4