How to crash a process on Windows-7 without getting the WER dialog?

后端 未结 2 1451
灰色年华
灰色年华 2021-02-08 20:22

Is it possible to crash a regular user-mode process on Windows-7 without getting the Windows Error Reporting (WER) dialog? (When and if WER is normally enabled and no specific

2条回答
  •  渐次进展
    2021-02-08 20:40

    You already know how to crash a process, so I answer regarding hiding the WER dialog.
    Way to hide WER dialog since Windows XP:

    UINT WINAPI SetErrorMode(_In_  UINT uMode);
    

    SEM_NOGPFAULTERRORBOX 0x0002 The system does not display the Windows Error Reporting dialog.

    Note that there are also other reasons for error dialogs and they can be disabled with this function too, check the documentation for more info.

    Additionally since Windows 7:

    BOOL SetThreadErrorMode(
      _In_   DWORD dwNewMode,
      _Out_  LPDWORD lpOldMode
    );
    

    Some programs and dll-s use these functions to hide errors from the user.

提交回复
热议问题