From: Brendan Shanks <bshanks@codeweavers.com> --- dlls/ntdll/tests/wow64.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 92d35d8647f..160979d2940 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -203,14 +203,14 @@ static BOOL create_process_machine( char *cmdline, DWORD flags, USHORT machine, return ret; } -static void test_process_architecture( HANDLE process, USHORT expect_machine, USHORT expect_native ) +static void test_process_architecture( SYSTEM_INFORMATION_CLASS class, HANDLE process, USHORT expect_machine, USHORT expect_native ) { SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; NTSTATUS status; ULONG i, len; len = 0xdead; - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + status = pNtQuerySystemInformationEx( class, &process, sizeof(process), machines, sizeof(machines), &len ); ok( !status, "failed %lx\n", status ); ok( !(len & 3), "wrong len %lx\n", len ); @@ -234,7 +234,7 @@ static void test_process_architecture( HANDLE process, USHORT expect_machine, US ok( !*(DWORD *)&machines[i], "missing terminating null\n" ); len = i * sizeof(machines[0]); - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + status = pNtQuerySystemInformationEx( class, &process, sizeof(process), machines, len, &len ); ok( status == STATUS_BUFFER_TOO_SMALL, "failed %lx\n", status ); ok( len == (i + 1) * sizeof(machines[0]), "wrong len %lu\n", len ); @@ -304,7 +304,7 @@ static void test_process_machine( HANDLE process, HANDLE thread, } } -static void test_query_architectures(void) +static void test_query_architectures(SYSTEM_INFORMATION_CLASS class) { static char cmd_sysnative[] = "C:\\windows\\sysnative\\cmd.exe /c exit"; static char cmd_system32[] = "C:\\windows\\system32\\cmd.exe /c exit"; @@ -324,7 +324,7 @@ static void test_query_architectures(void) if (!pNtQuerySystemInformationEx) return; process = GetCurrentProcess(); - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + status = pNtQuerySystemInformationEx( class, &process, sizeof(process), machines, sizeof(machines), &len ); if (status == STATUS_INVALID_INFO_CLASS) { @@ -334,39 +334,39 @@ static void test_query_architectures(void) ok( !status, "failed %lx\n", status ); process = (HANDLE)0xdeadbeef; - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + status = pNtQuerySystemInformationEx( class, &process, sizeof(process), machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_HANDLE, "failed %lx\n", status ); process = (HANDLE)0xdeadbeef; - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, 3, + status = pNtQuerySystemInformationEx( class, &process, 3, machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_PARAMETER || broken(status == STATUS_INVALID_HANDLE), "failed %lx\n", status ); process = GetCurrentProcess(); - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, 3, + status = pNtQuerySystemInformationEx( class, &process, 3, machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_PARAMETER || broken( status == STATUS_SUCCESS), "failed %lx\n", status ); - status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, NULL, 0, + status = pNtQuerySystemInformationEx( class, NULL, 0, machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status ); winetest_push_context( "current" ); - test_process_architecture( GetCurrentProcess(), is_win64 ? native_machine : current_machine, + test_process_architecture( class, GetCurrentProcess(), is_win64 ? native_machine : current_machine, native_machine ); test_process_machine( GetCurrentProcess(), GetCurrentThread(), current_machine, is_arm64ec ? native_machine : current_machine ); winetest_pop_context(); winetest_push_context( "zero" ); - test_process_architecture( 0, 0, native_machine ); + test_process_architecture( class, 0, 0, native_machine ); winetest_pop_context(); if (CreateProcessA( NULL, is_win64 ? cmd_system32 : cmd_sysnative, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi )) { winetest_push_context( "system32" ); - test_process_architecture( pi.hProcess, native_machine, native_machine ); + test_process_architecture( class, pi.hProcess, native_machine, native_machine ); test_process_machine( pi.hProcess, pi.hThread, is_win64 ? current_machine : native_machine, native_machine ); TerminateProcess( pi.hProcess, 0 ); @@ -378,7 +378,7 @@ static void test_query_architectures(void) FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi )) { winetest_push_context( "syswow64" ); - test_process_architecture( pi.hProcess, IMAGE_FILE_MACHINE_I386, native_machine ); + test_process_architecture( class, pi.hProcess, IMAGE_FILE_MACHINE_I386, native_machine ); test_process_machine( pi.hProcess, pi.hThread, IMAGE_FILE_MACHINE_I386, IMAGE_FILE_MACHINE_I386 ); TerminateProcess( pi.hProcess, 0 ); CloseHandle( pi.hProcess ); @@ -392,7 +392,7 @@ static void test_query_architectures(void) if (create_process_machine( cmd_system32, CREATE_SUSPENDED, machine, &pi )) { winetest_push_context( "%04x", machine ); - test_process_architecture( pi.hProcess, native_machine, native_machine ); + test_process_architecture( class, pi.hProcess, native_machine, native_machine ); test_process_machine( pi.hProcess, pi.hThread, machine, native_machine ); TerminateProcess( pi.hProcess, 0 ); CloseHandle( pi.hProcess ); @@ -3212,7 +3212,7 @@ static void test_arm64ec(void) START_TEST(wow64) { init(); - test_query_architectures(); + test_query_architectures(SystemSupportedProcessorArchitectures); test_peb_teb(); test_selectors(); test_image_mappings(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10526