-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] SuppressCrashReport should set SEM_FAILCRITICALERRORS #85118
Comments
In Including ---
For example: NtRaiseHardError = ctypes.windll.ntdll.NtRaiseHardError
response = (ctypes.c_ulong * 1)() With the default process error mode, the following raises a hard error dialog for >>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
0
>>> response[0]
2 The normal response value for the above call is limited to abort (2), retry (7), and ignore (4). The response is 0 if the process is set to fail critical errors: >>> msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS)
0
>>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
0
>>> response[0]
0
>>> NtRaiseHardError(0xC000_0001 | 0x1000_0000, 0, 0, None, 0, response)
0
>>> response[0]
2 A common case that doesn't use the override flag is when the loader fails to initialize a process. For the release build of Python 3.10, for example, if "python310.dll" can't be found, the loader tries to raise a hard error with the status code >>> os.rename('amd64/python310.dll', 'amd64/python310.dll.bak')
>>> # the following returns after clicking OK
>>> hex(subprocess.call('python'))
'0xc0000135' With >>> msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS)
0
>>> # the following returns immediately
>>> hex(subprocess.call('python'))
'0xc0000135' |
is this issue open? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: