-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-133572: Disable error reporting for invalid memory access on unsupported WinAPI partitions #133573
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
Conversation
Oh, it's only the error number conversion that's a problem? Let's just shim that bit out then and keep the SEH. Perhaps add this just before the macro and then call it? static void
_PyErr_SetFromNTSTATUS(NTSTATUS status) {
#if (macro here)
PyErr_SetFromWindowsErr(LsaNtStatusToWinError(status));
#else
if (status & 0x80000000) {
// HRESULT-shaped codes are supported by PyErr_SetFromWindowsErr
PyErr_SetFromWindowsErr((int)status);
} else {
// No mapping for NTSTATUS values, so just return it for diagnostic purposes
// If we provide it as winerror it could incorrectly change the type of the exception.
PyErr_Format(PyExc_OSError, "Operating system error NTSTATUS=0x%08lX", status & 0xFFFFFFFF);
}
#endif
} Or that function might even have a home with the other error setters, but I don't know that we've needed it anywhere else. If you want to put it in (IIRC) errors.c, don't make it static, but also don't use PyAPI_FUNC on it - no need for it to be exported from the DLL. |
And sorry about multiple changes - my fault for giving direction without having fully understood the problem! |
Both |
Perfect, thanks! |
aside from the mimalloc fix that has to be downstreamed later on this is the last change required to get cpython to compile on the xbox again