Message371233
Why doesn't SuppressCrashReport suppress the hard error dialog (i.e. SEM_FAILCRITICALERRORS)? This dialog gets created by the NtRaiseHardError system call. For example:
>>> NtRaiseHardError = ctypes.windll.ntdll.NtRaiseHardError
>>> response = (ctypes.c_ulong * 1)()
With the default OS error mode, the following raises a hard error dialog for STATUS_UNSUCCESSFUL (0xC0000001), with abort/retry/ignore options:
>>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
0
>>> response[0]
2
The response value is limited to abort (2), retry (7), ignore (4) -- or simply returned (0) when the process hard error mode is disabled:
>>> msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS)
0
>>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
0
>>> response[0]
0
NtRaiseHardError also checks for an error-mode override flag (0x1000_0000) in the status code, which is used in cases such as WinAPI FatalAppExitW. For example, the following will raise the dialog regardless of the hard error mode:
>>> NtRaiseHardError(0xC000_0001 | 0x1000_0000, 0, 0, None, 0, response)
0
>>> response[0]
2 |
|
Date |
User |
Action |
Args |
2020-06-10 18:41:22 | eryksun | set | recipients:
+ eryksun, db3l, vstinner, benjamin.peterson, stutzbach, serhiy.storchaka, JelleZijlstra, corona10, remi.lapeyre |
2020-06-10 18:41:22 | eryksun | set | messageid: <1591814482.39.0.111414199535.issue40826@roundup.psfhosted.org> |
2020-06-10 18:41:22 | eryksun | link | issue40826 messages |
2020-06-10 18:41:22 | eryksun | create | |
|