Exceptions silently caught by Windows, how to handle manually?

前端 未结 7 1245
一整个雨季
一整个雨季 2020-12-13 14:45

We\'re having problems with Windows silently eating exceptions and allowing the application to continue running, when the exception is thrown inside the message pump. For ex

相关标签:
7条回答
  • 2020-12-13 15:33

    After browsing similar questions I stumbled across this answer: OpenGL suppresses exceptions in MFC dialog-based application

    "Ok, I found out some more information about this. In my case it's windows 7 that installs KiUserCallbackExceptionHandler as exception handler, before calling my WndProc and giving me execution control. This is done by ntdll!KiUserCallbackDispatcher. I suspect that this is a security measure taken by Microsoft to prevent hacking into SEH.

    The solution is to wrap your wndproc (or hookproc) with a try/except frame."

    I've filed a bug report with Microsoft, you can see their response here:
    http://connect.microsoft.com/VisualStudio/feedback/details/550944/hardware-exceptions-on-x64-machines-are-silently-caught-in-wndproc-messages

    From Microsoft:

    Thanks for the report. I've found out that this is a Windows issue, and there is a hot fix available. Please see http://support.microsoft.com/kb/976038 for a fix that you can install if you wish.

    0 讨论(0)
提交回复
热议问题