[PATCH 0/2] MR9740: kernel32/tests: Add a test to show that GetNativeSystemInfo() returns PROCESSOR_AMD_X8664 on ARM64.
From: Hans Leidekker <hans@codeweavers.com> --- dlls/kernel32/tests/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index d66ab2efe66..11c4f2bafbe 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -436,7 +436,7 @@ static void test__lcreat( void ) filehandle=_lcreat (slashname, 0); /* illegal name */ ok( filehandle == HFILE_ERROR, "succeeded\n" ); err=GetLastError (); - ok (err==ERROR_INVALID_NAME || err==ERROR_PATH_NOT_FOUND, + ok (err == ERROR_INVALID_NAME || err == ERROR_PATH_NOT_FOUND || err == ERROR_DIRECTORY /* win11 */, "creating file \"%s\" failed with error %d\n", slashname, err); filehandle=_lcreat (filename, 8); /* illegal attribute */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9740
From: Hans Leidekker <hans@codeweavers.com> --- dlls/kernel32/tests/process.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 9d6dfb126e2..c39b5bf7b22 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2359,7 +2359,7 @@ static void test_SystemInfo(void) { SYSTEM_INFO si, nsi; BOOL is_wow64; - USHORT machine, native_machine; + USHORT machine, native_machine = 0; if (!pGetNativeSystemInfo) { @@ -2371,6 +2371,8 @@ static void test_SystemInfo(void) GetSystemInfo(&si); pGetNativeSystemInfo(&nsi); + if (pIsWow64Process2) pIsWow64Process2(GetCurrentProcess(), &machine, &native_machine); + if (is_wow64) { if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) @@ -2378,8 +2380,7 @@ static void test_SystemInfo(void) ok(nsi.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64, "Expected PROCESSOR_ARCHITECTURE_AMD64, got %d\n", nsi.wProcessorArchitecture); - if (pIsWow64Process2 && pIsWow64Process2(GetCurrentProcess(), &machine, &native_machine) && - native_machine == IMAGE_FILE_MACHINE_ARM64) + if (native_machine == IMAGE_FILE_MACHINE_ARM64) { ok(nsi.dwProcessorType == PROCESSOR_INTEL_PENTIUM, "got %ld\n", nsi.dwProcessorType); ok(nsi.wProcessorLevel == 15, "got %d\n", nsi.wProcessorLevel); @@ -2396,6 +2397,14 @@ static void test_SystemInfo(void) ok(si.dwProcessorType == nsi.dwProcessorType, "Expected no difference for dwProcessorType, got %ld and %ld\n", si.dwProcessorType, nsi.dwProcessorType); + if (native_machine == IMAGE_FILE_MACHINE_ARM64) + { + todo_wine { + ok(nsi.dwProcessorType == PROCESSOR_AMD_X8664, "got %lu\n", nsi.dwProcessorType); + ok(nsi.wProcessorLevel == 21, "got %u\n", nsi.wProcessorLevel); + ok(nsi.wProcessorRevision == 1, "got %u\n", nsi.wProcessorRevision); + } + } } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9740
This would be true only for an x86-64 binary, not a native ARM64 one. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_125279
I do see this with AMR64 binary. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_125280
I'm not sure it makes much sense, what Windows version is that? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_125288
Windows 11 (10.0.26200). It surprised me too but MSDN mentions it and it is consistent with the non-native processor type reported for a wow64 process, for which we already have tests. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_125294
As far as I understand MSDN says that it happens for x64 applications, not ARM64 ones. The wow64 case is of course for x86 binaries, so it makes sense there. It doesn't happen for me for ARM64 binaries on Windows 11 26080 or 27924: ``` process.c:2402: Test failed: got 0 process.c:2403: Test failed: got 0 process.c:2404: Test failed: got 0 ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_125320
I created !10210 to fix a different ARM64 problem with GetNativeSystemInfo() (in an amd64 process GetSystemInfo and GetNativeSystemInfo should be equivalent), but on Windows 11 26100 I'm also seeing these tests failing in an ARM64 binary. Hans, if you're building Wine and the tests as ARM64EC, maybe they're inadvertently running as amd64 instead of arm64? With `start /b /machine amd64 kernel32_test.exe process` all the tests pass. With `start /b /machine arm64 kernel32_test.exe process` I see the same failures as Alexandre. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_130799
Right, I do have a pure aarch64 build but maybe I got them mixed up. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740#note_130941
This merge request was closed by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9740
participants (5)
-
Alexandre Julliard (@julliard) -
Brendan Shanks (@bshanks) -
Hans Leidekker -
Hans Leidekker (@hans) -
Hans Leidekker (@hans)