Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54463
-- v2: ntdll: Look at CurrentMajor/MinorVersionNumber registry values before CurrentVersion. ntdll: Initialize PEB version numbers with Windows 10 values.
From: Hans Leidekker hans@codeweavers.com
--- dlls/ntdll/unix/env.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 6f1709f4713..79dc7ffc5c3 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1848,9 +1848,9 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module ) { peb->ImageBaseAddress = module; peb->ProcessParameters = params; - peb->OSMajorVersion = 6; - peb->OSMinorVersion = 1; - peb->OSBuildNumber = 0x1db1; + peb->OSMajorVersion = 10; + peb->OSMinorVersion = 0; + peb->OSBuildNumber = 18362; peb->OSPlatformId = VER_PLATFORM_WIN32_NT; peb->ImageSubSystem = main_image_info.SubSystemType; peb->ImageSubSystemMajorVersion = main_image_info.MajorSubsystemVersion;
From: Hans Leidekker hans@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54463 --- dlls/ntdll/version.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index 3a903c54c6b..9c396598d4e 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -276,18 +276,36 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
memset( version, 0, sizeof(*version) );
- RtlInitUnicodeString( &valueW, L"CurrentVersion" ); - if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count )) + RtlInitUnicodeString( &valueW, L"CurrentMajorVersionNumber" ); + if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ) && + info->Type == REG_DWORD) { - WCHAR *p, *str = (WCHAR *)info->Data; - str[info->DataLength / sizeof(WCHAR)] = 0; - p = wcschr( str, '.' ); - if (p) + version->dwMajorVersion = *(DWORD *)info->Data; + + RtlInitUnicodeString( &valueW, L"CurrentMinorVersionNumber" ); + if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ) && + info->Type == REG_DWORD) { - *p++ = 0; - version->dwMinorVersion = wcstoul( p, NULL, 10 ); + version->dwMinorVersion = *(DWORD *)info->Data; + } + else version->dwMajorVersion = 0; + } + + if (!version->dwMajorVersion) + { + RtlInitUnicodeString( &valueW, L"CurrentVersion" ); + if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count )) + { + WCHAR *p, *str = (WCHAR *)info->Data; + str[info->DataLength / sizeof(WCHAR)] = 0; + p = wcschr( str, '.' ); + if (p) + { + *p++ = 0; + version->dwMinorVersion = wcstoul( p, NULL, 10 ); + } + version->dwMajorVersion = wcstoul( str, NULL, 10 ); } - version->dwMajorVersion = wcstoul( str, NULL, 10 ); }
if (version->dwMajorVersion) /* we got the main version, now fetch the other fields */