Include older Windows 11 builds in the address space workaround (#3711)

For now, I've included up to Windows 11 22H2 in the workaround.
I've only personally seen reports of issues on Windows 11 21H2, but better safe than sorry (considering Windows 10 22H2 has issues).
This commit is contained in:
Stephen Miller
2025-10-05 14:46:06 -05:00
committed by GitHub
parent 4fa435490c
commit d17a4fb8cc

View File

@@ -118,9 +118,10 @@ struct AddressSpace::Impl {
RtlGetVersion(&os_version_info);
u64 supported_user_max = USER_MAX;
static constexpr s32 Windows11BuildNumber = 22000;
if (os_version_info.dwBuildNumber < Windows11BuildNumber) {
// Windows 10 has an issue with VirtualAlloc2 on higher addresses.
// This is the build number for Windows 11 22H2
static constexpr s32 AffectedBuildNumber = 22621;
if (os_version_info.dwBuildNumber <= AffectedBuildNumber) {
// Older Windows builds have an issue with VirtualAlloc2 on higher addresses.
// To prevent regressions, limit the maximum address we reserve for this platform.
supported_user_max = 0x11000000000ULL;
LOG_WARNING(Core, "Windows 10 detected, reducing user max to {:#x} to avoid problems",