02/11/2013

Overriding the SetUnhandledExceptionFilter for AutoCAD

If you have tried overriding AutoCAD’s Exception filter (the one that catches all unhandled exceptions and sends the Mini Crash Dump file to Autodesk for analysis) you are in for a hard time.

We prevent people from overriding our exception filter because, well, it makes no sense for us not to receive the crash dumps, even if it is caused by another application.

That said, sometimes you may *need* to override it… I get it… So here’s some code which shows how to override it. Basically, once we hook our AutoCAD unhandled exception filter using SetUnhandledExceptionFilter() we then disable the SetUnhandledExceptionFilter() function by directly patching a return instruction into the asm. So here’s what you need to do to get round it:

Comments

If you have tried overriding AutoCAD’s Exception filter (the one that catches all unhandled exceptions and sends the Mini Crash Dump file to Autodesk for analysis) you are in for a hard time.

We prevent people from overriding our exception filter because, well, it makes no sense for us not to receive the crash dumps, even if it is caused by another application.

That said, sometimes you may *need* to override it… I get it… So here’s some code which shows how to override it. Basically, once we hook our AutoCAD unhandled exception filter using SetUnhandledExceptionFilter() we then disable the SetUnhandledExceptionFilter() function by directly patching a return instruction into the asm. So here’s what you need to do to get round it: