Can I disable the unhandled exception handler for a process?

霸气de小男生 提交于 2019-12-25 07:12:10

问题


I am performing system tests on a SAP system. From time to time, SAP crashes and I'd like to recover from those crashes by resetting the virtual machine to a previously saved state.

My problem is that I cannot detect such crashes reliably. I have created WER LocalDumps registry entries, but I don't get dumps.

It seems SAP has registered an unhandled exception handler and performs different tasks on different types of exceptions. Sometimes it shows a message box and terminates the application (e.g. in case of compression errors), sometimes it goes with a so-called Short Dump.

I am neither interested in the message box, nor in the short dump, so I am looking for a way to disable the unhandled exception handler of SAP. This should bring up WER, which writes the dump file and I can take actions to restart my system tests.

For performance reasons, I'd not like to restart the VM on every test.

I have tried:

  • I am basically familiar with unhandled exception handlers. I have applied them to my own .NET code successfully.
  • I looked at SetUnhandledExceptionFilter (MSDN) and similar but it applies to the calling process only and I cannot modify the code of SAP.
  • I read about DisableUserModeCallbackFilter but I don't think it is helpful for my case

I wonder whether there is a Registry Setting (e.g. in ImageFileExecutionOptions) or a Shim that I could activate.


回答1:


According to Hans Passant's comment (which I take as an authorative answer),

There is no boss override switch built into the operating system to stop it from doing this.

I finally attached the debugger to SAP GUI at a time where the process was alive. Starting with all exceptions enabled, I narrowed down the conditions so that WinDbg would break when SAP GUI crashed (first chance, then second chance).



来源:https://stackoverflow.com/questions/32582279/can-i-disable-the-unhandled-exception-handler-for-a-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!