Skip to content

Commit 2121e28

Browse files
Merge pull request #3 from Gcenx/patch-1
Fixup reporting Windows reporting, default to Win10 and add Win11
2 parents 1f91010 + f5cf25b commit 2121e28

File tree

10 files changed

+173
-119
lines changed

10 files changed

+173
-119
lines changed

dlls/kernel32/version.rc

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
2525
#define WINE_FILEDESCRIPTION_STR "Wine kernel DLL"
2626
#define WINE_FILENAME_STR "kernel32.dll"
2727

28-
/* these values come from Windows 10 Version 1909 */
29-
#define WINE_FILEVERSION 10,0,18362,1350
30-
#define WINE_FILEVERSION_STR "10.0.18362.1350"
31-
#define WINE_PRODUCTVERSION 10,0,18362,1350
32-
#define WINE_PRODUCTVERSION_STR "10.0.18362.1350"
28+
/* these values come from Windows 10 Version 2009 */
29+
#define WINE_FILEVERSION 10,0,19043,1466
30+
#define WINE_FILEVERSION_STR "10.0.19043.1466"
31+
#define WINE_PRODUCTVERSION 10,0,19043,1466
32+
#define WINE_PRODUCTVERSION_STR "10.0.19043.1466"
3333

3434
#include "wine/wine_common_ver.rc"

dlls/kernelbase/version.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static const struct
156156
},
157157
/* Windows 10 */
158158
{
159-
{ 10, 0, 18362 },
159+
{ 10, 0, 19043 },
160160
{0x8e0f7a12,0xbfb3,0x4fe8,{0xb9,0xa5,0x48,0xfd,0x50,0xa1,0x5a,0x9a}}
161161
}
162162
};

dlls/msi/tests/package.c

+33-33
Original file line numberDiff line numberDiff line change
@@ -2137,17 +2137,17 @@ static void test_condition(void)
21372137
DeleteFileA(msifile);
21382138
}
21392139

2140-
static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case)
2140+
static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case, int todo_value)
21412141
{
21422142
char buffer[MAX_PATH] = "x";
21432143
DWORD sz = sizeof(buffer);
21442144
UINT r = MsiGetPropertyA(hpkg, prop, buffer, &sz);
21452145
ok(!r, "'%s': got %u\n", prop, r);
21462146
ok(sz == lstrlenA(buffer), "'%s': expected %u, got %lu\n", prop, lstrlenA(buffer), sz);
21472147
if (match_case)
2148-
ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
2148+
todo_wine_if (todo_value) ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
21492149
else
2150-
ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
2150+
todo_wine_if (todo_value) ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
21512151
}
21522152

21532153
static void test_props(void)
@@ -2220,29 +2220,29 @@ static void test_props(void)
22202220

22212221
r = MsiSetPropertyA( hpkg, "=", "asdf" );
22222222
ok(!r, "got %u\n", r);
2223-
check_prop(hpkg, "=", "asdf", 1);
2223+
check_prop(hpkg, "=", "asdf", 1, 0);
22242224

22252225
r = MsiSetPropertyA( hpkg, " ", "asdf" );
22262226
ok(!r, "got %u\n", r);
2227-
check_prop(hpkg, " ", "asdf", 1);
2227+
check_prop(hpkg, " ", "asdf", 1, 0);
22282228

22292229
r = MsiSetPropertyA( hpkg, "'", "asdf" );
22302230
ok(!r, "got %u\n", r);
2231-
check_prop(hpkg, "'", "asdf", 1);
2231+
check_prop(hpkg, "'", "asdf", 1, 0);
22322232

22332233
/* set empty values */
22342234
r = MsiSetPropertyA( hpkg, "boo", NULL );
22352235
ok(!r, "got %u\n", r);
2236-
check_prop(hpkg, "boo", "", 1);
2236+
check_prop(hpkg, "boo", "", 1, 0);
22372237

22382238
r = MsiSetPropertyA( hpkg, "boo", "" );
22392239
ok(!r, "got %u\n", r);
2240-
check_prop(hpkg, "boo", "", 1);
2240+
check_prop(hpkg, "boo", "", 1, 0);
22412241

22422242
/* set a non-empty value */
22432243
r = MsiSetPropertyA( hpkg, "boo", "xyz" );
22442244
ok(!r, "got %u\n", r);
2245-
check_prop(hpkg, "boo", "xyz", 1);
2245+
check_prop(hpkg, "boo", "xyz", 1, 0);
22462246

22472247
r = MsiGetPropertyA(hpkg, "boo", NULL, NULL);
22482248
ok(!r, "got %u\n", r);
@@ -2317,10 +2317,10 @@ static void test_props(void)
23172317
ok(sz == 3, "got size %lu\n", sz);
23182318

23192319
/* properties are case-sensitive */
2320-
check_prop(hpkg, "BOO", "", 1);
2320+
check_prop(hpkg, "BOO", "", 1, 0);
23212321

23222322
/* properties set in Property table should work */
2323-
check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1);
2323+
check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1, 0);
23242324

23252325
MsiCloseHandle( hpkg );
23262326
DeleteFileA(msifile);
@@ -5734,70 +5734,70 @@ static void test_installprops(void)
57345734
GetNativeSystemInfo(&si);
57355735

57365736
sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
5737-
check_prop(hpkg, "VersionNT", buf, 1);
5737+
check_prop(hpkg, "VersionNT", buf, 1, 1);
57385738

57395739
if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
57405740
{
57415741
sprintf(buf, "%d", si.wProcessorLevel);
5742-
check_prop(hpkg, "Intel", buf, 1);
5743-
check_prop(hpkg, "MsiAMD64", buf, 1);
5744-
check_prop(hpkg, "Msix64", buf, 1);
5742+
check_prop(hpkg, "Intel", buf, 1, 0);
5743+
check_prop(hpkg, "MsiAMD64", buf, 1, 0);
5744+
check_prop(hpkg, "Msix64", buf, 1, 0);
57455745
sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
5746-
check_prop(hpkg, "VersionNT64", buf, 1);
5746+
check_prop(hpkg, "VersionNT64", buf, 1, 1);
57475747

57485748
GetSystemDirectoryA(path, MAX_PATH);
57495749
strcat(path, "\\");
5750-
check_prop(hpkg, "System64Folder", path, 0);
5750+
check_prop(hpkg, "System64Folder", path, 0, 0);
57515751

57525752
GetSystemWow64DirectoryA(path, MAX_PATH);
57535753
strcat(path, "\\");
5754-
check_prop(hpkg, "SystemFolder", path, 0);
5754+
check_prop(hpkg, "SystemFolder", path, 0, 0);
57555755

57565756
size = MAX_PATH;
57575757
r = RegQueryValueExA(pathkey, "ProgramFilesDir (x86)", 0, &type, (BYTE *)path, &size);
57585758
strcat(path, "\\");
5759-
check_prop(hpkg, "ProgramFilesFolder", path, 0);
5759+
check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
57605760

57615761
size = MAX_PATH;
57625762
RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
57635763
strcat(path, "\\");
5764-
check_prop(hpkg, "ProgramFiles64Folder", path, 0);
5764+
check_prop(hpkg, "ProgramFiles64Folder", path, 0, 0);
57655765

57665766
size = MAX_PATH;
57675767
RegQueryValueExA(pathkey, "CommonFilesDir (x86)", 0, &type, (BYTE *)path, &size);
57685768
strcat(path, "\\");
5769-
check_prop(hpkg, "CommonFilesFolder", path, 0);
5769+
check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
57705770

57715771
size = MAX_PATH;
57725772
RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
57735773
strcat(path, "\\");
5774-
check_prop(hpkg, "CommonFiles64Folder", path, 0);
5774+
check_prop(hpkg, "CommonFiles64Folder", path, 0, 0);
57755775
}
57765776
else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
57775777
{
57785778
sprintf(buf, "%d", si.wProcessorLevel);
5779-
check_prop(hpkg, "Intel", buf, 1);
5779+
check_prop(hpkg, "Intel", buf, 1, 0);
57805780

57815781
GetSystemDirectoryA(path, MAX_PATH);
57825782
strcat(path, "\\");
5783-
check_prop(hpkg, "SystemFolder", path, 0);
5783+
check_prop(hpkg, "SystemFolder", path, 0, 0);
57845784

57855785
size = MAX_PATH;
57865786
RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
57875787
strcat(path, "\\");
5788-
check_prop(hpkg, "ProgramFilesFolder", path, 0);
5788+
check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
57895789

57905790
size = MAX_PATH;
57915791
RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
57925792
strcat(path, "\\");
5793-
check_prop(hpkg, "CommonFilesFolder", path, 0);
5794-
5795-
check_prop(hpkg, "MsiAMD64", "", 1);
5796-
check_prop(hpkg, "Msix64", "", 1);
5797-
check_prop(hpkg, "VersionNT64", "", 1);
5798-
check_prop(hpkg, "System64Folder", "", 0);
5799-
check_prop(hpkg, "ProgramFiles64Dir", "", 0);
5800-
check_prop(hpkg, "CommonFiles64Dir", "", 0);
5793+
check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
5794+
5795+
check_prop(hpkg, "MsiAMD64", "", 1, 0);
5796+
check_prop(hpkg, "Msix64", "", 1, 0);
5797+
check_prop(hpkg, "VersionNT64", "", 1, 0);
5798+
check_prop(hpkg, "System64Folder", "", 0, 0);
5799+
check_prop(hpkg, "ProgramFiles64Dir", "", 0, 0);
5800+
check_prop(hpkg, "CommonFiles64Dir", "", 0, 0);
58015801
}
58025802

58035803
CloseHandle(hkey1);

dlls/ntdll/loader.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -3843,13 +3843,7 @@ static NTSTATUS query_string_option( HANDLE hkey, LPCWSTR name, ULONG type,
38433843
NTSTATUS WINAPI LdrQueryImageFileExecutionOptions( const UNICODE_STRING *key, LPCWSTR value, ULONG type,
38443844
void *data, ULONG in_size, ULONG *out_size )
38453845
{
3846-
static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\\',
3847-
'S','o','f','t','w','a','r','e','\\',
3848-
'M','i','c','r','o','s','o','f','t','\\',
3849-
'W','i','n','d','o','w','s',' ','N','T','\\',
3850-
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
3851-
'I','m','a','g','e',' ','F','i','l','e',' ',
3852-
'E','x','e','c','u','t','i','o','n',' ','O','p','t','i','o','n','s','\\'};
3846+
static const WCHAR optionsW[] = L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options";
38533847
WCHAR path[MAX_PATH + ARRAY_SIZE( optionsW )];
38543848
OBJECT_ATTRIBUTES attr;
38553849
UNICODE_STRING name_str;
@@ -4291,7 +4285,7 @@ static void load_global_options(void)
42914285
attr.Attributes = OBJ_CASE_INSENSITIVE;
42924286
attr.SecurityDescriptor = NULL;
42934287
attr.SecurityQualityOfService = NULL;
4294-
RtlInitUnicodeString( &name_str, L"Machine\\System\\CurrentControlSet\\Control\\Session Manager" );
4288+
RtlInitUnicodeString( &name_str, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager" );
42954289

42964290
if (!NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr ))
42974291
{

dlls/ntdll/unix/env.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -1722,11 +1722,13 @@ static ULONG get_dword_option( HANDLE key, const WCHAR *name, ULONG defval )
17221722
*/
17231723
static void load_global_options( const UNICODE_STRING *image )
17241724
{
1725-
static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\\','S','o','f','t','w','a','r','e','\\',
1725+
static const WCHAR optionsW[] = {'\\','R','e','g','i','s','t','r','y','\\',
1726+
'M','a','c','h','i','n','e','\\','S','o','f','t','w','a','r','e','\\',
17261727
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\',
17271728
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
17281729
'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};
1729-
static const WCHAR sessionW[] = {'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\',
1730+
static const WCHAR sessionW[] = {'\\','R','e','g','i','s','t','r','y','\\',
1731+
'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\',
17301732
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
17311733
'C','o','n','t','r','o','l','\\','S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r',0};
17321734
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 )
18391841
{
18401842
peb->ImageBaseAddress = module;
18411843
peb->ProcessParameters = params;
1842-
peb->OSMajorVersion = 6;
1843-
peb->OSMinorVersion = 1;
1844-
peb->OSBuildNumber = 0x1db1;
1844+
peb->OSMajorVersion = 10;
1845+
peb->OSMinorVersion = 0;
1846+
peb->OSBuildNumber = 19043;
18451847
peb->OSPlatformId = VER_PLATFORM_WIN32_NT;
18461848
peb->ImageSubSystem = main_image_info.SubSystemType;
18471849
peb->ImageSubSystemMajorVersion = main_image_info.MajorSubsystemVersion;

dlls/ntdll/unix/system.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,8 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
21212121
static const WCHAR mui_stdW[] = { 'M','U','I','_','S','t','d',0 };
21222122
static const WCHAR mui_dltW[] = { 'M','U','I','_','D','l','t',0 };
21232123
static const WCHAR tziW[] = { 'T','Z','I',0 };
2124-
static const WCHAR Time_ZonesW[] = { 'M','a','c','h','i','n','e','\\',
2124+
static const WCHAR Time_ZonesW[] = { '\\','R','e','g','i','s','t','r','y','\\',
2125+
'M','a','c','h','i','n','e','\\',
21252126
'S','o','f','t','w','a','r','e','\\',
21262127
'M','i','c','r','o','s','o','f','t','\\',
21272128
'W','i','n','d','o','w','s',' ','N','T','\\',

dlls/ntdll/version.c

+40-16
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ typedef enum
5555
WIN8, /* Windows 8 */
5656
WIN81, /* Windows 8.1 */
5757
WIN10, /* Windows 10 */
58+
WIN11, /* Windows 11 */
5859
NB_WINDOWS_VERSIONS
5960
} WINDOWS_VERSION;
6061

@@ -167,10 +168,14 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
167168
},
168169
/* WIN10 */
169170
{
170-
sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 18362, VER_PLATFORM_WIN32_NT,
171+
sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 19043, VER_PLATFORM_WIN32_NT,
172+
L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
173+
},
174+
/* WIN11 */
175+
{
176+
sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 22000, VER_PLATFORM_WIN32_NT,
171177
L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
172178
},
173-
174179
};
175180

176181
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[] =
201206
{ L"win8", WIN8 },
202207
{ L"win81", WIN81 },
203208
{ L"win10", WIN10 },
209+
{ L"win11", WIN11 },
204210
};
205211

206212

@@ -264,24 +270,42 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
264270
attr.Attributes = 0;
265271
attr.SecurityDescriptor = NULL;
266272
attr.SecurityQualityOfService = NULL;
267-
RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion" );
273+
RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion" );
268274

269275
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
270276

271277
memset( version, 0, sizeof(*version) );
272278

273-
RtlInitUnicodeString( &valueW, L"CurrentVersion" );
274-
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
279+
RtlInitUnicodeString( &valueW, L"CurrentMajorVersionNumber" );
280+
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ) &&
281+
info->Type == REG_DWORD)
275282
{
276-
WCHAR *p, *str = (WCHAR *)info->Data;
277-
str[info->DataLength / sizeof(WCHAR)] = 0;
278-
p = wcschr( str, '.' );
279-
if (p)
283+
version->dwMajorVersion = *(DWORD *)info->Data;
284+
285+
RtlInitUnicodeString( &valueW, L"CurrentMinorVersionNumber" );
286+
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ) &&
287+
info->Type == REG_DWORD)
280288
{
281-
*p++ = 0;
282-
version->dwMinorVersion = wcstoul( p, NULL, 10 );
289+
version->dwMinorVersion = *(DWORD *)info->Data;
290+
}
291+
else version->dwMajorVersion = 0;
292+
}
293+
294+
if (!version->dwMajorVersion)
295+
{
296+
RtlInitUnicodeString( &valueW, L"CurrentVersion" );
297+
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
298+
{
299+
WCHAR *p, *str = (WCHAR *)info->Data;
300+
str[info->DataLength / sizeof(WCHAR)] = 0;
301+
p = wcschr( str, '.' );
302+
if (p)
303+
{
304+
*p++ = 0;
305+
version->dwMinorVersion = wcstoul( p, NULL, 10 );
306+
}
307+
version->dwMajorVersion = wcstoul( str, NULL, 10 );
283308
}
284-
version->dwMajorVersion = wcstoul( str, NULL, 10 );
285309
}
286310

287311
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 )
311335

312336
/* get service pack version */
313337

314-
RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\Windows" );
338+
RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Windows" );
315339
if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
316340
{
317341
RtlInitUnicodeString( &valueW, L"CSDVersion" );
@@ -329,7 +353,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
329353

330354
/* get product type */
331355

332-
RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\ProductOptions" );
356+
RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\ProductOptions" );
333357
if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
334358
{
335359
RtlInitUnicodeString( &valueW, L"ProductType" );
@@ -373,7 +397,7 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
373397
attr.Attributes = 0;
374398
attr.SecurityDescriptor = NULL;
375399
attr.SecurityQualityOfService = NULL;
376-
RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
400+
RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
377401

378402
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
379403

@@ -476,7 +500,7 @@ void version_init(void)
476500

477501
NtQuerySystemInformation( SystemWineVersionInformation, wine_version, sizeof(wine_version), NULL );
478502

479-
current_version = &VersionData[WIN7];
503+
current_version = &VersionData[WIN10];
480504

481505
/* awful CrossOver hack^H^H^H^Hproprietary enhancement */
482506
{

0 commit comments

Comments
 (0)