From ce86899386586ad42049138e890edcf244aa51ff Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Mon, 4 Jul 2022 14:38:35 +0200
Subject: [PATCH 01/10] ntdll: Use proper absolute paths for registry keys.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

cherry picked from commit https://github.com/wine-mirror/wine/commit/c6d96400076fd907378f8f2817d99ff4a4b1e9f4
---
 dlls/ntdll/loader.c      | 10 ++--------
 dlls/ntdll/unix/env.c    |  6 ++++--
 dlls/ntdll/unix/system.c |  3 ++-
 dlls/ntdll/version.c     |  8 ++++----
 4 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 51c619b7..0f1e2fa9 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3843,13 +3843,7 @@ static NTSTATUS query_string_option( HANDLE hkey, LPCWSTR name, ULONG type,
 NTSTATUS WINAPI LdrQueryImageFileExecutionOptions( const UNICODE_STRING *key, LPCWSTR value, ULONG type,
                                                    void *data, ULONG in_size, ULONG *out_size )
 {
-    static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\\',
-                                     'S','o','f','t','w','a','r','e','\\',
-                                     'M','i','c','r','o','s','o','f','t','\\',
-                                     'W','i','n','d','o','w','s',' ','N','T','\\',
-                                     'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
-                                     'I','m','a','g','e',' ','F','i','l','e',' ',
-                                     'E','x','e','c','u','t','i','o','n',' ','O','p','t','i','o','n','s','\\'};
+    static const WCHAR optionsW[] = L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options";
     WCHAR path[MAX_PATH + ARRAY_SIZE( optionsW )];
     OBJECT_ATTRIBUTES attr;
     UNICODE_STRING name_str;
@@ -4291,7 +4285,7 @@ static void load_global_options(void)
     attr.Attributes = OBJ_CASE_INSENSITIVE;
     attr.SecurityDescriptor = NULL;
     attr.SecurityQualityOfService = NULL;
-    RtlInitUnicodeString( &name_str, L"Machine\\System\\CurrentControlSet\\Control\\Session Manager" );
+    RtlInitUnicodeString( &name_str, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager" );
 
     if (!NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr ))
     {
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index abfef178..0a9c5036 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1722,11 +1722,13 @@ static ULONG get_dword_option( HANDLE key, const WCHAR *name, ULONG defval )
  */
 static void load_global_options( const UNICODE_STRING *image )
 {
-    static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\\','S','o','f','t','w','a','r','e','\\',
+    static const WCHAR optionsW[] = {'\\','R','e','g','i','s','t','r','y','\\',
+        'M','a','c','h','i','n','e','\\','S','o','f','t','w','a','r','e','\\',
         'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\',
         'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
         'I','m','a','g','e',' ','F','i','l','e',' ','E','x','e','c','u','t','i','o','n',' ','O','p','t','i','o','n','s',0};
-    static const WCHAR sessionW[] = {'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\',
+    static const WCHAR sessionW[] = {'\\','R','e','g','i','s','t','r','y','\\',
+        'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\',
         'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
         'C','o','n','t','r','o','l','\\','S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r',0};
     static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 9c295952..833ebe8c 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2122,7 +2122,8 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
     static const WCHAR mui_stdW[] = { 'M','U','I','_','S','t','d',0 };
     static const WCHAR mui_dltW[] = { 'M','U','I','_','D','l','t',0 };
     static const WCHAR tziW[] = { 'T','Z','I',0 };
-    static const WCHAR Time_ZonesW[] = { 'M','a','c','h','i','n','e','\\',
+    static const WCHAR Time_ZonesW[] = { '\\','R','e','g','i','s','t','r','y','\\',
+        'M','a','c','h','i','n','e','\\',
         'S','o','f','t','w','a','r','e','\\',
         'M','i','c','r','o','s','o','f','t','\\',
         'W','i','n','d','o','w','s',' ','N','T','\\',
diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 2e9a5913..1ff81b6f 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -264,7 +264,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
     attr.Attributes = 0;
     attr.SecurityDescriptor = NULL;
     attr.SecurityQualityOfService = NULL;
-    RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion" );
+    RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion" );
 
     if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
 
@@ -311,7 +311,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
 
         /* get service pack version */
 
-        RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\Windows" );
+        RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Windows" );
         if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
         {
             RtlInitUnicodeString( &valueW, L"CSDVersion" );
@@ -329,7 +329,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
 
         /* get product type */
 
-        RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\ProductOptions" );
+        RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\ProductOptions" );
         if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
         {
             RtlInitUnicodeString( &valueW, L"ProductType" );
@@ -373,7 +373,7 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
     attr.Attributes = 0;
     attr.SecurityDescriptor = NULL;
     attr.SecurityQualityOfService = NULL;
-    RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
+    RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
 
     if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
 
-- 
2.39.3 (Apple Git-146)

From 5bcef82a3c244868c9aec4881e866baaefb43cb9 Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Mon, 23 Jan 2023 13:01:08 +0100
Subject: [PATCH 02/10] ntdll: Add Windows 11 version.

cherry picked from commit https://github.com/wine-mirror/wine/commit/2ccc2a42d7e257b7f6f1a9035e44a30f551e2643
---
 dlls/ntdll/version.c           | 8 +++++++-
 programs/winecfg/appdefaults.c | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 1ff81b6f..03316cbd 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -55,6 +55,7 @@ typedef enum
     WIN8,    /* Windows 8 */
     WIN81,   /* Windows 8.1 */
     WIN10,   /* Windows 10 */
+    WIN11,   /* Windows 11 */
     NB_WINDOWS_VERSIONS
 } WINDOWS_VERSION;
 
@@ -170,7 +171,11 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
         sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 18362, VER_PLATFORM_WIN32_NT,
         L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
     },
-
+    /* WIN11 */
+    {
+        sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 22000, VER_PLATFORM_WIN32_NT,
+        L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+    },
 };
 
 static const struct { WCHAR name[12]; WINDOWS_VERSION ver; } version_names[] =
@@ -201,6 +206,7 @@ static const struct { WCHAR name[12]; WINDOWS_VERSION ver; } version_names[] =
     { L"win8", WIN8 },
     { L"win81", WIN81 },
     { L"win10", WIN10 },
+    { L"win11", WIN11 },
 };
 
 
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index c20570a4..d556785d 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -50,6 +50,7 @@ struct win_version
 
 static const struct win_version win_versions[] =
 {
+    { L"win11",     L"Windows 11",       10,  0, 22000, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win10",     L"Windows 10",       10,  0, 18362, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win81",     L"Windows 8.1",       6,  3,  9600, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win8",      L"Windows 8",         6,  2,  9200, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
--
2.39.3 (Apple Git-146)

From f68903039785d0950c88f781082f36632d783e54 Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Mon, 23 Jan 2023 13:15:07 +0100
Subject: [PATCH 03/10] ntdll: Default to Windows 10.

cherry picked from commit https://github.com/wine-mirror/wine/commit/69154f0329aec4fb64886a0689da198b5323dcde
---
 dlls/msi/tests/package.c       | 66 +++++++++++++++++-----------------
 dlls/ntdll/version.c           |  2 +-
 loader/wine.inf.in             | 32 ++++++++---------
 programs/winecfg/appdefaults.c |  2 +-
 4 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 05633c4b..cad396aa 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -2137,7 +2137,7 @@ static void test_condition(void)
     DeleteFileA(msifile);
 }
 
-static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case)
+static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case, int todo_value)
 {
     char buffer[MAX_PATH] = "x";
     DWORD sz = sizeof(buffer);
@@ -2145,9 +2145,9 @@ static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int
     ok(!r, "'%s': got %u\n", prop, r);
     ok(sz == lstrlenA(buffer), "'%s': expected %u, got %lu\n", prop, lstrlenA(buffer), sz);
     if (match_case)
-        ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
+        todo_wine_if (todo_value) ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
     else
-        ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
+        todo_wine_if (todo_value) ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
 }
 
 static void test_props(void)
@@ -2220,29 +2220,29 @@ static void test_props(void)
 
     r = MsiSetPropertyA( hpkg, "=", "asdf" );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, "=", "asdf", 1);
+    check_prop(hpkg, "=", "asdf", 1, 0);
 
     r = MsiSetPropertyA( hpkg, " ", "asdf" );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, " ", "asdf", 1);
+    check_prop(hpkg, " ", "asdf", 1, 0);
 
     r = MsiSetPropertyA( hpkg, "'", "asdf" );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, "'", "asdf", 1);
+    check_prop(hpkg, "'", "asdf", 1, 0);
 
     /* set empty values */
     r = MsiSetPropertyA( hpkg, "boo", NULL );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, "boo", "", 1);
+    check_prop(hpkg, "boo", "", 1, 0);
 
     r = MsiSetPropertyA( hpkg, "boo", "" );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, "boo", "", 1);
+    check_prop(hpkg, "boo", "", 1, 0);
 
     /* set a non-empty value */
     r = MsiSetPropertyA( hpkg, "boo", "xyz" );
     ok(!r, "got %u\n", r);
-    check_prop(hpkg, "boo", "xyz", 1);
+    check_prop(hpkg, "boo", "xyz", 1, 0);
 
     r = MsiGetPropertyA(hpkg, "boo", NULL, NULL);
     ok(!r, "got %u\n", r);
@@ -2317,10 +2317,10 @@ static void test_props(void)
     ok(sz == 3, "got size %lu\n", sz);
 
     /* properties are case-sensitive */
-    check_prop(hpkg, "BOO", "", 1);
+    check_prop(hpkg, "BOO", "", 1, 0);
 
     /* properties set in Property table should work */
-    check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1);
+    check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1, 0);
 
     MsiCloseHandle( hpkg );
     DeleteFileA(msifile);
@@ -5734,70 +5734,70 @@ static void test_installprops(void)
     GetNativeSystemInfo(&si);
 
     sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
-    check_prop(hpkg, "VersionNT", buf, 1);
+    check_prop(hpkg, "VersionNT", buf, 1, 1);
 
     if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
     {
         sprintf(buf, "%d", si.wProcessorLevel);
-        check_prop(hpkg, "Intel", buf, 1);
-        check_prop(hpkg, "MsiAMD64", buf, 1);
-        check_prop(hpkg, "Msix64", buf, 1);
+        check_prop(hpkg, "Intel", buf, 1, 0);
+        check_prop(hpkg, "MsiAMD64", buf, 1, 0);
+        check_prop(hpkg, "Msix64", buf, 1, 0);
         sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
-        check_prop(hpkg, "VersionNT64", buf, 1);
+        check_prop(hpkg, "VersionNT64", buf, 1, 1);
 
         GetSystemDirectoryA(path, MAX_PATH);
         strcat(path, "\\");
-        check_prop(hpkg, "System64Folder", path, 0);
+        check_prop(hpkg, "System64Folder", path, 0, 0);
 
         GetSystemWow64DirectoryA(path, MAX_PATH);
         strcat(path, "\\");
-        check_prop(hpkg, "SystemFolder", path, 0);
+        check_prop(hpkg, "SystemFolder", path, 0, 0);
 
         size = MAX_PATH;
         r = RegQueryValueExA(pathkey, "ProgramFilesDir (x86)", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "ProgramFilesFolder", path, 0);
+        check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
 
         size = MAX_PATH;
         RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "ProgramFiles64Folder", path, 0);
+        check_prop(hpkg, "ProgramFiles64Folder", path, 0, 0);
 
         size = MAX_PATH;
         RegQueryValueExA(pathkey, "CommonFilesDir (x86)", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "CommonFilesFolder", path, 0);
+        check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
 
         size = MAX_PATH;
         RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "CommonFiles64Folder", path, 0);
+        check_prop(hpkg, "CommonFiles64Folder", path, 0, 0);
     }
     else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
     {
         sprintf(buf, "%d", si.wProcessorLevel);
-        check_prop(hpkg, "Intel", buf, 1);
+        check_prop(hpkg, "Intel", buf, 1, 0);
 
         GetSystemDirectoryA(path, MAX_PATH);
         strcat(path, "\\");
-        check_prop(hpkg, "SystemFolder", path, 0);
+        check_prop(hpkg, "SystemFolder", path, 0, 0);
 
         size = MAX_PATH;
         RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "ProgramFilesFolder", path, 0);
+        check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
 
         size = MAX_PATH;
         RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
         strcat(path, "\\");
-        check_prop(hpkg, "CommonFilesFolder", path, 0);
-
-        check_prop(hpkg, "MsiAMD64", "", 1);
-        check_prop(hpkg, "Msix64", "", 1);
-        check_prop(hpkg, "VersionNT64", "", 1);
-        check_prop(hpkg, "System64Folder", "", 0);
-        check_prop(hpkg, "ProgramFiles64Dir", "", 0);
-        check_prop(hpkg, "CommonFiles64Dir", "", 0);
+        check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
+
+        check_prop(hpkg, "MsiAMD64", "", 1, 0);
+        check_prop(hpkg, "Msix64", "", 1, 0);
+        check_prop(hpkg, "VersionNT64", "", 1, 0);
+        check_prop(hpkg, "System64Folder", "", 0, 0);
+        check_prop(hpkg, "ProgramFiles64Dir", "", 0, 0);
+        check_prop(hpkg, "CommonFiles64Dir", "", 0, 0);
     }
 
     CloseHandle(hkey1);
diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 03316cbd..3a89792a 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -482,7 +482,7 @@ void version_init(void)
 
     NtQuerySystemInformation( SystemWineVersionInformation, wine_version, sizeof(wine_version), NULL );
 
-    current_version = &VersionData[WIN7];
+    current_version = &VersionData[WIN10];
 
     /* awful CrossOver hack^H^H^H^Hproprietary enhancement */
     {
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 69611642..fc4fe6ed 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -5092,13 +5092,12 @@ HKLM,"System\CurrentControlSet\Services\Winsock\Parameters",,16
 HKLM,"System\CurrentControlSet\Services\Winsock2\Parameters\Protocol_Catalog9\Catalog_Entries",,16
 
 [VersionInfo]
-HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.1"
-HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10001,6
-HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10001,1
-HKLM,%CurrentVersionNT%,"CSDVersion",2,"Service Pack 1"
-HKLM,%CurrentVersionNT%,"CurrentBuild",2,"7601"
-HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"7601"
-HKLM,%CurrentVersionNT%,"CurrentType",2,"Uniprocessor Free"
+HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
+HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10001,10
+HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10001,0
+HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
 HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
@@ -5106,17 +5105,18 @@ HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-HKLM,%CurrentVersionNT%,"ProductName",2,"Microsoft Windows 7"
+HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro"
 HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT"
-HKLM,%Control%\Windows,"CSDVersion",0x10003,0x100
+HKLM,%Control%\Windows,"CSDVersion",0x10003,0
 HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT"
 
 [VersionInfo.ntamd64]
-HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.1"
-HKLM,%CurrentVersionNT%,"CSDVersion",2,"Service Pack 1"
-HKLM,%CurrentVersionNT%,"CurrentBuild",2,"7601"
-HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"7601"
-HKLM,%CurrentVersionNT%,"CurrentType",2,"Uniprocessor Free"
+HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
+HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10001,10
+HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10001,0
+HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
 HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
@@ -5124,9 +5124,9 @@ HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-HKLM,%CurrentVersionNT%,"ProductName",2,"Microsoft Windows 7"
+HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro"
 HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT"
-HKLM,%Control%\Windows,"CSDVersion",0x10003,0x100
+HKLM,%Control%\Windows,"CSDVersion",0x10003,0
 HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT"
 
 [Wow64]
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index d556785d..385ef9af 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -75,7 +75,7 @@ static const struct win_version win_versions[] =
 #endif
 };
 
-#define DEFAULT_WIN_VERSION   L"win7"
+#define DEFAULT_WIN_VERSION   L"win10"
 
 static const WCHAR szKey9x[] = L"Software\\Microsoft\\Windows\\CurrentVersion";
 static const WCHAR szKeyNT[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion";
--
2.39.3 (Apple Git-146)

From 4d36d4e47402f282e3183b8aa10af861d4567afd Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Mon, 23 Jan 2023 15:09:58 +0100
Subject: [PATCH 04/10] winecfg: Fix CurrentVersion registry string for Windows
 10 and up.

It no longer reflects the real OS major and minor version numbers.

cherry picked from commit https://github.com/wine-mirror/wine/commit/3a819255f57e54917c598e66e60efb875162f8a3
---
 programs/winecfg/appdefaults.c | 88 +++++++++++++++++++++-------------
 1 file changed, 55 insertions(+), 33 deletions(-)

diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index 385ef9af..04574592 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -38,6 +38,7 @@ struct win_version
 {
     const WCHAR *szVersion;
     const WCHAR *szDescription;
+    const WCHAR *szCurrentVersion;
     DWORD        dwMajorVersion;
     DWORD        dwMinorVersion;
     DWORD        dwBuildNumber;
@@ -50,28 +51,28 @@ struct win_version
 
 static const struct win_version win_versions[] =
 {
-    { L"win11",     L"Windows 11",       10,  0, 22000, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
-    { L"win10",     L"Windows 10",       10,  0, 18362, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
-    { L"win81",     L"Windows 8.1",       6,  3,  9600, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
-    { L"win8",      L"Windows 8",         6,  2,  9200, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
-    { L"win2008r2", L"Windows 2008 R2",   6,  1,  7601, VER_PLATFORM_WIN32_NT, L"Service Pack 1", 1, 0, L"ServerNT"},
-    { L"win7",      L"Windows 7",         6,  1,  7601, VER_PLATFORM_WIN32_NT, L"Service Pack 1", 1, 0, L"WinNT"},
-    { L"win2008",   L"Windows 2008",      6,  0,  6002, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"ServerNT"},
-    { L"vista",     L"Windows Vista",     6,  0,  6002, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"WinNT"},
-    { L"win2003",   L"Windows 2003",      5,  2,  3790, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"ServerNT"},
+    { L"win11",     L"Windows 11",      L"6.3", 10,  0, 22000, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
+    { L"win10",     L"Windows 10",      L"6.3", 10,  0, 18362, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
+    { L"win81",     L"Windows 8.1",     NULL,    6,  3,  9600, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
+    { L"win8",      L"Windows 8",       NULL,    6,  2,  9200, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
+    { L"win2008r2", L"Windows 2008 R2", NULL,    6,  1,  7601, VER_PLATFORM_WIN32_NT, L"Service Pack 1", 1, 0, L"ServerNT"},
+    { L"win7",      L"Windows 7",       NULL,    6,  1,  7601, VER_PLATFORM_WIN32_NT, L"Service Pack 1", 1, 0, L"WinNT"},
+    { L"win2008",   L"Windows 2008",    NULL,    6,  0,  6002, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"ServerNT"},
+    { L"vista",     L"Windows Vista",   NULL,    6,  0,  6002, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"WinNT"},
+    { L"win2003",   L"Windows 2003",    NULL,    5,  2,  3790, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"ServerNT"},
 #ifdef _WIN64
-    { L"winxp64",   L"Windows XP",        5,  2,  3790, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"WinNT"},
+    { L"winxp64",   L"Windows XP",      NULL,    5,  2,  3790, VER_PLATFORM_WIN32_NT, L"Service Pack 2", 2, 0, L"WinNT"},
 #else
-    { L"winxp",     L"Windows XP",        5,  1,  2600, VER_PLATFORM_WIN32_NT, L"Service Pack 3", 3, 0, L"WinNT"},
-    { L"win2k",     L"Windows 2000",      5,  0,  2195, VER_PLATFORM_WIN32_NT, L"Service Pack 4", 4, 0, L"WinNT"},
-    { L"winme",     L"Windows ME",        4, 90,  3000, VER_PLATFORM_WIN32_WINDOWS, L" ", 0, 0, L""},
-    { L"win98",     L"Windows 98",        4, 10,  2222, VER_PLATFORM_WIN32_WINDOWS, L" A ", 0, 0, L""},
-    { L"win95",     L"Windows 95",        4,  0,   950, VER_PLATFORM_WIN32_WINDOWS, L"", 0, 0, L""},
-    { L"nt40",      L"Windows NT 4.0",    4,  0,  1381, VER_PLATFORM_WIN32_NT, L"Service Pack 6a", 6, 0, L"WinNT"},
-    { L"nt351",     L"Windows NT 3.51",   3, 51,  1057, VER_PLATFORM_WIN32_NT, L"Service Pack 5", 5, 0, L"WinNT"},
-    { L"win31",     L"Windows 3.1",       3, 10,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""},
-    { L"win30",     L"Windows 3.0",       3,  0,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""},
-    { L"win20",     L"Windows 2.0",       2,  0,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""}
+    { L"winxp",     L"Windows XP",      NULL,    5,  1,  2600, VER_PLATFORM_WIN32_NT, L"Service Pack 3", 3, 0, L"WinNT"},
+    { L"win2k",     L"Windows 2000",    NULL,    5,  0,  2195, VER_PLATFORM_WIN32_NT, L"Service Pack 4", 4, 0, L"WinNT"},
+    { L"winme",     L"Windows ME",      NULL,    4, 90,  3000, VER_PLATFORM_WIN32_WINDOWS, L" ", 0, 0, L""},
+    { L"win98",     L"Windows 98",      NULL,    4, 10,  2222, VER_PLATFORM_WIN32_WINDOWS, L" A ", 0, 0, L""},
+    { L"win95",     L"Windows 95",      NULL,    4,  0,   950, VER_PLATFORM_WIN32_WINDOWS, L"", 0, 0, L""},
+    { L"nt40",      L"Windows NT 4.0",  NULL,    4,  0,  1381, VER_PLATFORM_WIN32_NT, L"Service Pack 6a", 6, 0, L"WinNT"},
+    { L"nt351",     L"Windows NT 3.51", NULL,    3, 51,  1057, VER_PLATFORM_WIN32_NT, L"Service Pack 5", 5, 0, L"WinNT"},
+    { L"win31",     L"Windows 3.1",     NULL,    3, 10,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""},
+    { L"win30",     L"Windows 3.0",     NULL,    3,  0,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""},
+    { L"win20",     L"Windows 2.0",     NULL,    2,  0,     0, VER_PLATFORM_WIN32s, L"Win32s 1.3", 0, 0, L""}
 #endif
 };
 
@@ -81,9 +82,20 @@ static const WCHAR szKey9x[] = L"Software\\Microsoft\\Windows\\CurrentVersion";
 static const WCHAR szKeyNT[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion";
 static const WCHAR szKeyProdNT[] = L"System\\CurrentControlSet\\Control\\ProductOptions";
 
+static DWORD get_reg_dword( HKEY root, const WCHAR *subkey, const WCHAR *value )
+{
+    HKEY hkey;
+    DWORD ret, len = sizeof(ret), type;
+
+    if (RegOpenKeyExW( root, subkey, 0, KEY_QUERY_VALUE, &hkey )) return 0;
+    if (RegQueryValueExW( hkey, value, NULL, &type, (BYTE *)&ret, &len ) || type != REG_DWORD) ret = 0;
+    RegCloseKey( hkey );
+    return ret;
+}
+
 static int get_registry_version(void)
 {
-    int i, best = -1, platform, major, minor = 0, build = 0;
+    int i, best = -1, platform, major = 0, minor = 0, build = 0;
     WCHAR *p, *ver, *type = NULL;
 
     if ((ver = get_reg_key( HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentVersion", NULL )))
@@ -92,6 +104,9 @@ static int get_registry_version(void)
 
         platform = VER_PLATFORM_WIN32_NT;
 
+        major = get_reg_dword( HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentMajorVersionNumber" );
+        minor = get_reg_dword( HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentMinorVersionNumber" );
+
         build_str = get_reg_key( HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentBuildNumber", NULL );
         build = wcstol(build_str, NULL, 10);
 
@@ -102,19 +117,22 @@ static int get_registry_version(void)
     else
         return -1;
 
-    if ((p = wcschr( ver, '.' )))
+    if (!major)
     {
-        WCHAR *minor_str = p;
-        *minor_str++ = 0;
-        if ((p = wcschr( minor_str, '.' )))
+        if ((p = wcschr( ver, '.' )))
         {
-            WCHAR *build_str = p;
-            *build_str++ = 0;
-            build = wcstol(build_str, NULL, 10);
+            WCHAR *minor_str = p;
+            *minor_str++ = 0;
+            if ((p = wcschr( minor_str, '.' )))
+            {
+                WCHAR *build_str = p;
+                *build_str++ = 0;
+                build = wcstol(build_str, NULL, 10);
+            }
+            minor = wcstol(minor_str, NULL, 10);
         }
-        minor = wcstol(minor_str, NULL, 10);
+        major = wcstol(ver, NULL, 10);
     }
-    major = wcstol(ver, NULL, 10);
 
     for (i = 0; i < ARRAY_SIZE(win_versions); i++)
     {
@@ -429,9 +447,13 @@ static void set_winver(const struct win_version *version)
             break;
 
         case VER_PLATFORM_WIN32_NT:
-            swprintf(buffer, ARRAY_SIZE(buffer), L"%d.%d", version->dwMajorVersion,
-                        version->dwMinorVersion);
-            set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentVersion", buffer);
+            if (version->szCurrentVersion)
+                set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentVersion", version->szCurrentVersion);
+            else
+            {
+                swprintf(buffer, ARRAY_SIZE(buffer), L"%d.%d", version->dwMajorVersion, version->dwMinorVersion);
+                set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentVersion", buffer);
+            }
             set_reg_key_dword(HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentMajorVersionNumber", version->dwMajorVersion);
             set_reg_key_dword(HKEY_LOCAL_MACHINE, szKeyNT, L"CurrentMinorVersionNumber", version->dwMinorVersion);
             set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, L"CSDVersion", version->szCSDVersion);
--
2.39.3 (Apple Git-146)

From bbf2b7c75608f560d81b814e408bea1fb15dee8c Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Wed, 1 Feb 2023 12:10:50 +0100
Subject: [PATCH 05/10] wbemprox: Recognize Windows 11.

cherry picked from commit https://github.com/wine-mirror/wine/commit/34a797e8784ddaa01857563440c609e33049ef66
---
 dlls/wbemprox/builtin.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 142f0bfd..17792d70 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -3602,6 +3602,7 @@ static WCHAR *get_osbuildnumber( OSVERSIONINFOEXW *ver )
     if (ret) swprintf( ret, 11, L"%u", ver->dwBuildNumber );
     return ret;
 }
+
 static WCHAR *get_oscaption( OSVERSIONINFOEXW *ver )
 {
     static const WCHAR windowsW[] = L"Microsoft Windows ";
@@ -3616,12 +3617,17 @@ static WCHAR *get_oscaption( OSVERSIONINFOEXW *ver )
     static const WCHAR win8W[] = L"8 Pro";
     static const WCHAR win81W[] = L"8.1 Pro";
     static const WCHAR win10W[] = L"10 Pro";
+    static const WCHAR win11W[] = L"11 Pro";
     int len = ARRAY_SIZE( windowsW ) - 1;
     WCHAR *ret;
 
     if (!(ret = malloc( len * sizeof(WCHAR) + sizeof(win2003W) ))) return NULL;
     memcpy( ret, windowsW, sizeof(windowsW) );
-    if (ver->dwMajorVersion == 10 && ver->dwMinorVersion == 0) memcpy( ret + len, win10W, sizeof(win10W) );
+    if (ver->dwMajorVersion == 10 && ver->dwMinorVersion == 0)
+    {
+        if (ver->dwBuildNumber >= 22000) memcpy( ret + len, win11W, sizeof(win11W) );
+        else memcpy( ret + len, win10W, sizeof(win10W) );
+    }
     else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 3) memcpy( ret + len, win81W, sizeof(win81W) );
     else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 2) memcpy( ret + len, win8W, sizeof(win8W) );
     else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 1)
@@ -3643,6 +3649,7 @@ static WCHAR *get_oscaption( OSVERSIONINFOEXW *ver )
     else memcpy( ret + len, win2000W, sizeof(win2000W) );
     return ret;
 }
+
 static WCHAR *get_osname( const WCHAR *caption )
 {
     static const WCHAR partitionW[] = L"|C:\\WINDOWS|\\Device\\Harddisk0\\Partition1";
@@ -3668,6 +3675,7 @@ static WCHAR *get_osversion( OSVERSIONINFOEXW *ver )
     if (ret) swprintf( ret, 33, L"%u.%u.%u", ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber );
     return ret;
 }
+
 static DWORD get_operatingsystemsku(void)
 {
     DWORD ret = PRODUCT_UNDEFINED;
--
2.39.3 (Apple Git-146)

From 05bfd8a81713880d15d8de5987e1482d9d1c141a Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Thu, 9 Feb 2023 16:51:41 +0100
Subject: [PATCH 06/10] ntdll: Initialize PEB version numbers with Windows 10
 values.

cherry picked from commit https://github.com/wine-mirror/wine/commit/65a3e1499b15a2da4971e2bab48c3943beb06f96
---
 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 0a9c5036..f0d8cb8e 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1841,9 +1841,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;
--
2.39.3 (Apple Git-146)

From 2b16017512838b126afb0d079f087d49e62adf93 Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Thu, 9 Feb 2023 13:45:02 +0100
Subject: [PATCH 07/10] ntdll: Look at CurrentMajor/MinorVersionNumber registry
 values before CurrentVersion.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54463

cherry picked from commit https://github.com/wine-mirror/wine/commit/0692d07f85f30ee5191a781b8b6f51006f2ae407
---
 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 3a89792a..7b5a88f9 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 */
--
2.39.3 (Apple Git-146)

From 7eb64bca1fc7a71c9a7a34623c917d683f6e9ae8 Mon Sep 17 00:00:00 2001
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Date: Sat, 25 Mar 2023 18:32:07 +0100
Subject: [PATCH 08/10] wine.inf: Add EditionID to
 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54675

cherry picked from commit https://github.com/wine-mirror/wine/commit/e8b0c9239562ed78c94d7dba87d5004b4d82b113
---
 loader/wine.inf.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index fc4fe6ed..f0fcb0d8 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -5105,6 +5105,7 @@ HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
+HKLM,%CurrentVersionNT%,"EditionId",2,"Professional"
 HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro"
 HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT"
 HKLM,%Control%\Windows,"CSDVersion",0x10003,0
@@ -5124,6 +5125,7 @@ HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
+HKLM,%CurrentVersionNT%,"EditionId",2,"Professional"
 HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro"
 HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT"
 HKLM,%Control%\Windows,"CSDVersion",0x10003,0
--
2.39.3 (Apple Git-146)

From 9258c32d0c82f3115e91846a87316f93e24f2a29 Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Mon, 17 Apr 2023 10:16:08 +0200
Subject: [PATCH 09/10] wine.inf: Use FLG_ADDREG_NOCLOBBER for
 CurrentMajor/MinorVersionNumber.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54844

cherry picked commit https://github.com/wine-mirror/wine/commit/956e580f0656a8191489d1fd354f3038d0ea1431
---
 loader/wine.inf.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index f0fcb0d8..124e0861 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -5093,8 +5093,8 @@ HKLM,"System\CurrentControlSet\Services\Winsock2\Parameters\Protocol_Catalog9\Ca
 
 [VersionInfo]
 HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
-HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10001,10
-HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10001,0
+HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10003,10
+HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0
 HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
 HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
 HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
@@ -5113,8 +5113,8 @@ HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT"
 
 [VersionInfo.ntamd64]
 HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
-HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10001,10
-HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10001,0
+HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10003,10
+HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0
 HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
 HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
 HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
--
2.39.3 (Apple Git-146)

From 9ced00acfabccafc6fa520b56c0e218d7cece08e Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Mon, 30 Oct 2023 18:32:18 +0100
Subject: [PATCH 10/10] ntdll: Bump current build number to 19043 (Win10 2009).

Based on Proton commit 0fa76dd66a8.

cherry picked from commit https://github.com/wine-mirror/wine/commit/fd00d8e4cc11e494745184897133aff8718316c8
---
 dlls/kernel32/version.rc       | 10 +++++-----
 dlls/kernelbase/version.c      |  2 +-
 dlls/ntdll/unix/env.c          |  2 +-
 dlls/ntdll/version.c           |  2 +-
 loader/wine.inf.in             |  8 ++++----
 programs/winecfg/appdefaults.c |  2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/kernel32/version.rc b/dlls/kernel32/version.rc
index b6002f51..f91262df 100644
--- a/dlls/kernel32/version.rc
+++ b/dlls/kernel32/version.rc
@@ -25,10 +25,10 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 #define WINE_FILEDESCRIPTION_STR "Wine kernel DLL"
 #define WINE_FILENAME_STR "kernel32.dll"
 
-/* these values come from Windows 10 Version 1909 */
-#define WINE_FILEVERSION 10,0,18362,1350
-#define WINE_FILEVERSION_STR "10.0.18362.1350"
-#define WINE_PRODUCTVERSION 10,0,18362,1350
-#define WINE_PRODUCTVERSION_STR "10.0.18362.1350"
+/* these values come from Windows 10 Version 2009 */
+#define WINE_FILEVERSION 10,0,19043,1466
+#define WINE_FILEVERSION_STR "10.0.19043.1466"
+#define WINE_PRODUCTVERSION 10,0,19043,1466
+#define WINE_PRODUCTVERSION_STR "10.0.19043.1466"
 
 #include "wine/wine_common_ver.rc"
diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c
index 01e29d55..eb1dd46b 100644
--- a/dlls/kernelbase/version.c
+++ b/dlls/kernelbase/version.c
@@ -156,7 +156,7 @@ static const struct
     },
     /* Windows 10 */
     {
-        { 10, 0, 18362 },
+        { 10, 0, 19043 },
         {0x8e0f7a12,0xbfb3,0x4fe8,{0xb9,0xa5,0x48,0xfd,0x50,0xa1,0x5a,0x9a}}
     }
 };
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index f0d8cb8e..a39c8a10 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1843,7 +1843,7 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
     peb->ProcessParameters          = params;
     peb->OSMajorVersion             = 10;
     peb->OSMinorVersion             = 0;
-    peb->OSBuildNumber              = 18362;
+    peb->OSBuildNumber              = 19043;
     peb->OSPlatformId               = VER_PLATFORM_WIN32_NT;
     peb->ImageSubSystem             = main_image_info.SubSystemType;
     peb->ImageSubSystemMajorVersion = main_image_info.MajorSubsystemVersion;
diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 7b5a88f9..ba9d0732 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -168,7 +168,7 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
     },
     /* WIN10 */
     {
-        sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 18362, VER_PLATFORM_WIN32_NT,
+        sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 19043, VER_PLATFORM_WIN32_NT,
         L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
     },
     /* WIN11 */
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 124e0861..e3530555 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -5095,8 +5095,8 @@ HKLM,"System\CurrentControlSet\Services\Winsock2\Parameters\Protocol_Catalog9\Ca
 HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
 HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10003,10
 HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0
-HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
-HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentBuild",2,"19043"
+HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"19043"
 HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
 HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
@@ -5115,8 +5115,8 @@ HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT"
 HKLM,%CurrentVersionNT%,"CurrentVersion",2,"6.3"
 HKLM,%CurrentVersionNT%,"CurrentMajorVersionNumber",0x10003,10
 HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0
-HKLM,%CurrentVersionNT%,"CurrentBuild",2,"18362"
-HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"18362"
+HKLM,%CurrentVersionNT%,"CurrentBuild",2,"19043"
+HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"19043"
 HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free"
 HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index 04574592..08c97cdd 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -52,7 +52,7 @@ struct win_version
 static const struct win_version win_versions[] =
 {
     { L"win11",     L"Windows 11",      L"6.3", 10,  0, 22000, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
-    { L"win10",     L"Windows 10",      L"6.3", 10,  0, 18362, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
+    { L"win10",     L"Windows 10",      L"6.3", 10,  0, 19043, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win81",     L"Windows 8.1",     NULL,    6,  3,  9600, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win8",      L"Windows 8",       NULL,    6,  2,  9200, VER_PLATFORM_WIN32_NT, L"", 0, 0, L"WinNT"},
     { L"win2008r2", L"Windows 2008 R2", NULL,    6,  1,  7601, VER_PLATFORM_WIN32_NT, L"Service Pack 1", 1, 0, L"ServerNT"},
--
2.39.3 (Apple Git-146)

