The non-x86 (#else) branch of win32_is_vista_system() returned FALSE
when dwMajorVersion >= 6, which is backwards: Windows Vista is NT 6.0,
so the function must return TRUE for major version >= 6. The x86 branch
was already correct ((raw_version & 0xff) >= 6 -> TRUE).
On x64 Windows this reported every Vista-or-later system as pre-Vista.
For win32-kldbg this is fatal: win32_kldbg_setup() bails out with
"requires Windows Vista or higher version", so the Kernel Local Debugging
Driver access method is never used and PCIe extended config space (and
thus Lane Margining) is unreachable on 64-bit Windows.
Fix by testing dwMajorVersion < 6. GetVersionEx() may report 6.2 without
a compatibility manifest, but < 6 is correct regardless of that cap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
version.dwOSVersionInfoSize = sizeof(version);
if (!GetVersionEx(&version) ||
version.dwPlatformId != VER_PLATFORM_WIN32_NT ||
- version.dwMajorVersion >= 6)
+ version.dwMajorVersion < 6)
return FALSE;
else
return TRUE;