diff --git a/dlls/kernel32/version.rc b/dlls/kernel32/version.rc index b6002f51f7ab..f91262dfa8ee 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 01e29d55dfcf..eb1dd46ba7cf 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/msi/tests/package.c b/dlls/msi/tests/package.c index 05633c4b6df6..cad396aa05a3 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/loader.c b/dlls/ntdll/loader.c index 51c619b7f8c1..0f1e2fa966e2 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 abfef178d2c3..a39c8a10c99b 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}; @@ -1839,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 = 19043; peb->OSPlatformId = VER_PLATFORM_WIN32_NT; peb->ImageSubSystem = main_image_info.SubSystemType; peb->ImageSubSystemMajorVersion = main_image_info.MajorSubsystemVersion; diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 90fedc64e665..5f0942932843 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2121,7 +2121,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 2e9a5913748c..ba9d0732db27 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; @@ -167,10 +168,14 @@ 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 */ + { + 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 }, }; @@ -264,24 +270,42 @@ 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; 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 */ @@ -311,7 +335,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 +353,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 +397,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; @@ -476,7 +500,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/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 142f0bfdfdac..17792d70d64f 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; diff --git a/loader/wine.inf.in b/loader/wine.inf.in index f46e781e2661..8a2b7e9549f1 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",0x10003,10 +HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0 +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,\ 00,00,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,19 @@ 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%,"EditionId",2,"Professional" +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",0x10003,10 +HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0 +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,\ 00,00,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 +5125,10 @@ 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%,"EditionId",2,"Professional" +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 c20570a40e51..08c97cdda70b 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,39 +51,51 @@ struct win_version static const struct win_version win_versions[] = { - { 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, 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"}, + { 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 }; -#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"; 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 ))) @@ -91,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); @@ -101,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++) { @@ -428,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);