gh-152433: Windows: fix errors in sys.getwindowsversion() for UWP build#152604
gh-152433: Windows: fix errors in sys.getwindowsversion() for UWP build#152604thexai wants to merge 1 commit into
Conversation
|
For more context, the actual issue with e.g: in Windows 11 25H2 return (but not directly observable because only is used as second fallback on With this change, it will be possible use In UWP, it would be the primary method because WMI is not available and Related to #129294 |
sys.getwindowsversion() use RtlGetVersion for Desktop|
Updated with alternative fix: // Obtain the build number from Windows registry in case of Windows 10/11
if (realMajor == 10 && realMinor == 0) {
wchar_t currentBuild[32] = {0};
DWORD len = sizeof(currentBuild);
if (ERROR_SUCCESS == RegGetValueW(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, L"CurrentBuild",
RRF_RT_REG_SZ, NULL, ¤tBuild, &len))
{
realBuild = _wtol(currentBuild);
}
} |
|
|
Okay, we'll take it one step at a time... |
Uh oh!
There was an error while loading. Please reload this page.