Message371233
| Author |
eryksun |
| Recipients |
JelleZijlstra, benjamin.peterson, corona10, db3l, eryksun, remi.lapeyre, serhiy.storchaka, stutzbach, vstinner |
| Date |
2020年06月10日.18:41:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1591814482.39.0.111414199535.issue40826@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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 |
|