Marking as a draft for now, until !4605 is merged first.
From: Nikolay Sivov nsivov@codeweavers.com
--- include/ddk/wdm.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 7dcec028a50..54b9e6aa199 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1657,8 +1657,12 @@ static inline void IoCopyCurrentIrpStackLocationToNext(IRP *irp) next->Control = 0; }
-#define KernelMode 0 -#define UserMode 1 +typedef enum _MODE +{ + KernelMode, + UserMode, + MaximumMode +} MODE;
/* directory object access rights */ #define DIRECTORY_QUERY 0x0001
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ntdll/process.c | 20 +++++++-------- dlls/ntdll/tests/wow64.c | 48 +++++++++++++++++------------------- dlls/ntdll/unix/system.c | 23 ++++++++++++----- dlls/wow64/system.c | 2 +- include/winnt.h | 11 +++++++++ programs/regsvr32/regsvr32.c | 9 ++++--- programs/wineboot/wineboot.c | 17 +++++++------ 7 files changed, 76 insertions(+), 54 deletions(-)
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index f3b899a43f8..02e31ea7f4b 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -108,19 +108,18 @@ USHORT WINAPI RtlWow64GetCurrentMachine(void) */ NTSTATUS WINAPI RtlWow64GetProcessMachines( HANDLE process, USHORT *current_ret, USHORT *native_ret ) { - ULONG i, machines[8]; + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; USHORT current = 0, native = 0; NTSTATUS status; + ULONG i;
status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), machines, sizeof(machines), NULL ); if (status) return status; - for (i = 0; machines[i]; i++) + for (i = 0; machines[i].Machine; i++) { - USHORT flags = HIWORD(machines[i]); - USHORT machine = LOWORD(machines[i]); - if (flags & 4 /* native machine */) native = machine; - else if (flags & 8 /* current machine */) current = machine; + if (machines[i].Native) native = machines[i].Machine; + else if (machines[i].Process) current = machines[i].Machine; } if (current_ret) *current_ret = current; if (native_ret) *native_ret = native; @@ -148,18 +147,19 @@ NTSTATUS WINAPI RtlWow64GetSharedInfoProcess( HANDLE process, BOOLEAN *is_wow64, */ NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported( USHORT machine, BOOLEAN *supported ) { - ULONG i, machines[8]; + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; HANDLE process = 0; NTSTATUS status; + ULONG i;
status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), machines, sizeof(machines), NULL ); if (status) return status; *supported = FALSE; - for (i = 0; machines[i]; i++) + for (i = 0; machines[i].Machine; i++) { - if (HIWORD(machines[i]) & 4 /* native machine */) continue; - if (machine == LOWORD(machines[i])) *supported = TRUE; + if (machines[i].Native) continue; + if (machine == machines[i].Machine) *supported = TRUE; } return status; } diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 12e3582e5b6..01cd0cad035 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -141,40 +141,37 @@ static void init(void)
static void test_process_architecture( HANDLE process, USHORT expect_machine, USHORT expect_native ) { + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; NTSTATUS status; - ULONG i, len, buffer[8]; + ULONG i, len;
len = 0xdead; status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), - &buffer, sizeof(buffer), &len ); + machines, sizeof(machines), &len ); ok( !status, "failed %lx\n", status ); ok( !(len & 3), "wrong len %lx\n", len ); - len /= sizeof(DWORD); + len /= sizeof(machines[0]); for (i = 0; i < len - 1; i++) { - USHORT flags = HIWORD(buffer[i]); - USHORT machine = LOWORD(buffer[i]); - - if (flags & 8) - ok( machine == expect_machine, "wrong current machine %lx\n", buffer[i]); + if (machines[i].Process) + ok( machines[i].Machine == expect_machine, "wrong process machine %x\n", machines[i].Machine); else - ok( machine != expect_machine, "wrong machine %lx\n", buffer[i]); + ok( machines[i].Machine != expect_machine, "wrong machine %x\n", machines[i].Machine);
- /* FIXME: not quite sure what the other flags mean, - * observed on amd64 Windows: (flags & 7) == 7 for MACHINE_AMD64 and 2 for MACHINE_I386 - */ - if (flags & 4) - ok( machine == expect_native, "wrong native machine %lx\n", buffer[i]); + if (machines[i].Native) + ok( machines[i].Machine == expect_native, "wrong native machine %x\n", machines[i].Machine); else - ok( machine != expect_native, "wrong machine %lx\n", buffer[i]); + ok( machines[i].Machine != expect_native, "wrong machine %x\n", machines[i].Machine); + + /* FIXME: test other fields */ } - ok( !buffer[i], "missing terminating null\n" ); + ok( !*(DWORD *)&machines[i], "missing terminating null\n" );
- len = i * sizeof(DWORD); + len = i * sizeof(machines[0]); status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), - &buffer, len, &len ); + machines, len, &len ); ok( status == STATUS_BUFFER_TOO_SMALL, "failed %lx\n", status ); - ok( len == (i + 1) * sizeof(DWORD), "wrong len %lu\n", len ); + ok( len == (i + 1) * sizeof(machines[0]), "wrong len %lu\n", len );
if (pRtlWow64GetProcessMachines) { @@ -191,17 +188,18 @@ static void test_process_architecture( HANDLE process, USHORT expect_machine, US
static void test_query_architectures(void) { + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; PROCESS_INFORMATION pi; STARTUPINFOA si = { sizeof(si) }; NTSTATUS status; HANDLE process; - ULONG len, buffer[8]; + ULONG len;
if (!pNtQuerySystemInformationEx) return;
process = GetCurrentProcess(); status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), - &buffer, sizeof(buffer), &len ); + machines, sizeof(machines), &len ); if (status == STATUS_INVALID_INFO_CLASS) { win_skip( "SystemSupportedProcessorArchitectures not supported\n" ); @@ -211,20 +209,20 @@ static void test_query_architectures(void)
process = (HANDLE)0xdeadbeef; status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), - &buffer, sizeof(buffer), &len ); + machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_HANDLE, "failed %lx\n", status ); process = (HANDLE)0xdeadbeef; status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, 3, - &buffer, sizeof(buffer), &len ); + 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, - &buffer, sizeof(buffer), &len ); + machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_PARAMETER || broken( status == STATUS_SUCCESS), "failed %lx\n", status ); status = pNtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, NULL, 0, - &buffer, sizeof(buffer), &len ); + machines, sizeof(machines), &len ); ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
test_process_architecture( GetCurrentProcess(), current_machine, native_machine ); diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 5516831a7b7..879a5893758 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -3365,6 +3365,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx( SYSTEM_INFORMATION_CLASS class,
case SystemSupportedProcessorArchitectures: { + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION *machines = info; HANDLE process; ULONG i; USHORT machine = 0; @@ -3382,7 +3383,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx( SYSTEM_INFORMATION_CLASS class, if (ret) return ret; }
- len = (supported_machines_count + 1) * sizeof(ULONG); + len = (supported_machines_count + 1) * sizeof(*machines); if (size < len) { ret = STATUS_BUFFER_TOO_SMALL; @@ -3390,12 +3391,22 @@ NTSTATUS WINAPI NtQuerySystemInformationEx( SYSTEM_INFORMATION_CLASS class, } for (i = 0; i < supported_machines_count; i++) { - USHORT flags = 2; /* supported (?) */ - if (!i) flags |= 5; /* native machine (?) */ - if (supported_machines[i] == machine) flags |= 8; /* current machine */ - ((DWORD *)info)[i] = MAKELONG( supported_machines[i], flags ); + machines[i].Machine = supported_machines[i]; + machines[i].UserMode = 1; + machines[i].KernelMode = machines[i].Native = i == 0; + machines[i].Process = supported_machines[i] == machine; + machines[i].WoW64Container = 0; + machines[i].ReservedZero0 = 0; } - ((DWORD *)info)[i] = 0; + + machines[i].Machine = 0; + machines[i].KernelMode = 0; + machines[i].UserMode = 0; + machines[i].Native = 0; + machines[i].Process = 0; + machines[i].WoW64Container = 0; + machines[i].ReservedZero0 = 0; + ret = STATUS_SUCCESS; break; } diff --git a/dlls/wow64/system.c b/dlls/wow64/system.c index ba19ef5314d..7130039e07a 100644 --- a/dlls/wow64/system.c +++ b/dlls/wow64/system.c @@ -657,7 +657,7 @@ NTSTATUS WINAPI wow64_NtQuerySystemInformationEx( UINT *args ) }
case SystemCpuSetInformation: /* SYSTEM_CPU_SET_INFORMATION */ - case SystemSupportedProcessorArchitectures: /* ULONG */ + case SystemSupportedProcessorArchitectures: /* SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION */ return NtQuerySystemInformationEx( class, &handle, sizeof(handle), ptr, len, retlen );
default: diff --git a/include/winnt.h b/include/winnt.h index 67fcc010172..20db9a8aabd 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6595,6 +6595,17 @@ typedef struct _SYSTEM_CPU_SET_INFORMATION } DUMMYUNIONNAME; } SYSTEM_CPU_SET_INFORMATION, *PSYSTEM_CPU_SET_INFORMATION;
+typedef struct _SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION +{ + DWORD Machine : 16; + DWORD KernelMode : 1; + DWORD UserMode : 1; + DWORD Native : 1; + DWORD Process : 1; + DWORD WoW64Container : 1; + DWORD ReservedZero0 : 11; +} SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION; + /* Threadpool things */ typedef DWORD TP_VERSION,*PTP_VERSION;
diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c index 98038652505..18c664f436a 100644 --- a/programs/regsvr32/regsvr32.c +++ b/programs/regsvr32/regsvr32.c @@ -112,20 +112,21 @@ static LPCWSTR find_arg_start(LPCWSTR cmdline)
static void reexec_self( WORD machine ) { + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; WCHAR app[MAX_PATH]; LPCWSTR args; WCHAR *cmdline; - ULONG i, machines[8]; HANDLE process = 0; STARTUPINFOW si = {0}; PROCESS_INFORMATION pi; void *cookie; + ULONG i;
NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), machines, sizeof(machines), NULL ); - for (i = 0; machines[i]; i++) if (LOWORD(machines[i]) == machine) break; - if (!machines[i]) return; - if (HIWORD(machines[i]) & 4 /* native machine */) machine = IMAGE_FILE_MACHINE_TARGET_HOST; + for (i = 0; machines[i].Machine; i++) if (machines[i].Machine == machine) break; + if (!machines[i].Machine) return; + if (machines[i].Native) machine = IMAGE_FILE_MACHINE_TARGET_HOST; if (!GetSystemWow64Directory2W( app, MAX_PATH, machine )) return; wcscat( app, L"\regsvr32.exe" );
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index d996aa83f95..c16446cf289 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -357,6 +357,7 @@ static UINT64 read_tsc_frequency(void)
static void create_user_shared_data(void) { + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; struct _KUSER_SHARED_DATA *data; RTL_OSVERSIONINFOEXW version; SYSTEM_CPU_INFORMATION sci; @@ -366,7 +367,7 @@ static void create_user_shared_data(void) UNICODE_STRING name = RTL_CONSTANT_STRING( L"\KernelObjects\__wine_user_shared_data" ); NTSTATUS status; HANDLE handle; - ULONG i, machines[8]; + ULONG i; HANDLE process = 0;
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); @@ -446,9 +447,9 @@ static void create_user_shared_data(void) if (!NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), machines, sizeof(machines), NULL )) { - for (i = 0; machines[i]; i++) + for (i = 0; machines[i].Machine; i++) { - switch (LOWORD(machines[i])) + switch (machines[i].Machine) { case IMAGE_FILE_MACHINE_ARMNT: features[PF_ARM_VFP_32_REGISTERS_AVAILABLE] = TRUE; @@ -1596,12 +1597,12 @@ static void update_wineprefix( BOOL force )
if (update_timestamp( config_dir, st.st_mtime ) || force) { - ULONG machines[8]; + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; HANDLE process = 0; DWORD count = 0;
if (NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), - machines, sizeof(machines), NULL )) machines[0] = 0; + machines, sizeof(machines), NULL )) machines[0].Machine = 0;
if ((process = start_rundll32( inf_path, L"PreInstall", IMAGE_FILE_MACHINE_TARGET_HOST ))) { @@ -1619,11 +1620,11 @@ static void update_wineprefix( BOOL force ) } CloseHandle( process ); } - if (!machines[count]) break; - if (HIWORD(machines[count]) & 4 /* native machine */) + if (!machines[count].Machine) break; + if (machines[count].Native) process = start_rundll32( inf_path, L"DefaultInstall", IMAGE_FILE_MACHINE_TARGET_HOST ); else - process = start_rundll32( inf_path, L"Wow64Install", LOWORD(machines[count]) ); + process = start_rundll32( inf_path, L"Wow64Install", machines[count].Machine ); count++; } DestroyWindow( hwnd );
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/tests/process.c | 57 +++++++++++++++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/process.c | 51 +++++++++++++++++++++++++++++ include/winbase.h | 15 +++++++++ 5 files changed, 125 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 7e2a2ae8064..f92d6bf0738 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -798,6 +798,7 @@ @ stdcall -import GetProcessHeaps(long ptr) RtlGetProcessHeaps @ stdcall -import GetProcessId(long) @ stdcall -import GetProcessIdOfThread(long) +@ stdcall GetProcessInformation(long long ptr long) @ stdcall GetProcessIoCounters(long ptr) @ stdcall -import GetProcessMitigationPolicy(long long ptr long) @ stdcall -import GetProcessPreferredUILanguages(long ptr ptr ptr) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index d59074b988c..5f5327245fc 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -96,6 +96,7 @@ static BOOL (WINAPI *pUpdateProcThreadAttribute)(struct _PROC_THREAD_ATTRIBUTE static void (WINAPI *pDeleteProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*); static DWORD (WINAPI *pGetActiveProcessorCount)(WORD); static DWORD (WINAPI *pGetMaximumProcessorCount)(WORD); +static BOOL (WINAPI *pGetProcessInformation)(HANDLE,PROCESS_INFORMATION_CLASS,void*,DWORD);
/* ############################### */ static char base[MAX_PATH]; @@ -282,6 +283,7 @@ static BOOL init(void) pDeleteProcThreadAttributeList = (void *)GetProcAddress(hkernel32, "DeleteProcThreadAttributeList"); pGetActiveProcessorCount = (void *)GetProcAddress(hkernel32, "GetActiveProcessorCount"); pGetMaximumProcessorCount = (void *)GetProcAddress(hkernel32, "GetMaximumProcessorCount"); + pGetProcessInformation = (void *)GetProcAddress(hkernel32, "GetProcessInformation");
return TRUE; } @@ -5279,6 +5281,60 @@ static void test_startupinfo( void ) params->dwFlags ^= STARTF_USESTDHANDLES; }
+static void test_GetProcessInformation(void) +{ + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; + PROCESS_MACHINE_INFORMATION mi; + NTSTATUS status; + HANDLE process; + unsigned int i; + BOOL ret; + + if (!pGetProcessInformation) + { + win_skip("GetProcessInformation() is not available.\n"); + return; + } + + ret = pGetProcessInformation(GetCurrentProcess(), ProcessMachineTypeInfo, NULL, 0); + ok(!ret, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_BAD_LENGTH, "Unexpected error %ld.\n", GetLastError()); + ret = pGetProcessInformation(GetCurrentProcess(), ProcessMachineTypeInfo, &mi, 0); + ok(!ret, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_BAD_LENGTH, "Unexpected error %ld.\n", GetLastError()); + ret = pGetProcessInformation(GetCurrentProcess(), ProcessMachineTypeInfo, &mi, sizeof(mi) - 1); + ok(!ret, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_BAD_LENGTH, "Unexpected error %ld.\n", GetLastError()); + ret = pGetProcessInformation(GetCurrentProcess(), ProcessMachineTypeInfo, &mi, sizeof(mi) + 1); + ok(!ret, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_BAD_LENGTH, "Unexpected error %ld.\n", GetLastError()); + + ret = pGetProcessInformation(GetCurrentProcess(), ProcessMachineTypeInfo, &mi, sizeof(mi)); + ok(ret, "Unexpected return value %d.\n", ret); + + process = GetCurrentProcess(); + status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + machines, sizeof(machines), NULL ); + ok(!status, "Failed to get architectures information.\n"); + for (i = 0; machines[i].Machine; i++) + { + if (machines[i].Process) + { + ok(mi.ProcessMachine == machines[i].Machine, "Unexpected process machine %#x.\n", mi.ProcessMachine); + ok(!mi.Res0, "Unexpected process machine %#x.\n", mi.ProcessMachine); + ok(!!(mi.MachineAttributes & UserEnabled) == machines[i].UserMode, "Unexpected attributes %#x.\n", + mi.MachineAttributes); + ok(!!(mi.MachineAttributes & KernelEnabled) == machines[i].KernelMode, "Unexpected attributes %#x.\n", + mi.MachineAttributes); + ok(!!(mi.MachineAttributes & Wow64Container) == machines[i].WoW64Container, "Unexpected attributes %#x.\n", + mi.MachineAttributes); + ok(!(mi.MachineAttributes & ~(UserEnabled | KernelEnabled | Wow64Container)), "Unexpected attributes %#x.\n", + mi.MachineAttributes); + break; + } + } +} + START_TEST(process) { HANDLE job, hproc, h, h2; @@ -5408,6 +5464,7 @@ START_TEST(process) test_dead_process(); test_services_exe(); test_startupinfo(); + test_GetProcessInformation();
/* things that can be tested: * lookup: check the way program to be executed is searched diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index e85f2b67d74..ffb153a46ee 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -660,7 +660,7 @@ @ stdcall GetProcessIdOfThread(long) @ stdcall GetProcessImageFileNameA(long ptr long) @ stdcall GetProcessImageFileNameW(long ptr long) -# @ stub GetProcessInformation +@ stdcall GetProcessInformation(long long ptr long) @ stdcall GetProcessMemoryInfo(long ptr long) @ stdcall GetProcessMitigationPolicy(long long ptr long) @ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 0c5104e7452..1aeb8f55257 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -1038,6 +1038,57 @@ BOOL WINAPI DECLSPEC_HOTPATCH IsWow64Process( HANDLE process, PBOOL wow64 ) return set_ntstatus( status ); }
+/********************************************************************* + * GetProcessInformation (kernelbase.@) + */ +BOOL WINAPI GetProcessInformation( HANDLE process, PROCESS_INFORMATION_CLASS info_class, void *data, DWORD size ) +{ + switch (info_class) + { + case ProcessMachineTypeInfo: + { + PROCESS_MACHINE_INFORMATION *mi = data; + SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION machines[8]; + NTSTATUS status; + ULONG i; + + if (size != sizeof(*mi)) + { + SetLastError(ERROR_BAD_LENGTH); + return FALSE; + } + + status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + machines, sizeof(machines), NULL ); + if (status) return set_ntstatus( status ); + + for (i = 0; machines[i].Machine; i++) + { + if (machines[i].Process) + { + mi->ProcessMachine = machines[i].Machine; + mi->Res0 = 0; + mi->MachineAttributes = 0; + if (machines[i].KernelMode) + mi->MachineAttributes |= KernelEnabled; + if (machines[i].UserMode) + mi->MachineAttributes |= UserEnabled; + if (machines[i].WoW64Container) + mi->MachineAttributes |= Wow64Container; + + return TRUE; + } + } + + break; + } + default: + FIXME("Unsupported information class %d.\n", info_class); + } + + return FALSE; +} +
/********************************************************************* * OpenProcess (kernelbase.@) diff --git a/include/winbase.h b/include/winbase.h index 16e449f7c2d..fe143cc7a61 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1771,6 +1771,20 @@ typedef struct _WIN32_MEMORY_RANGE_ENTRY SIZE_T NumberOfBytes; } WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY;
+typedef enum _MACHINE_ATTRIBUTES +{ + UserEnabled = 0x00000001, + KernelEnabled = 0x00000002, + Wow64Container = 0x00000004, +} MACHINE_ATTRIBUTES; + +typedef struct _PROCESS_MACHINE_INFORMATION +{ + USHORT ProcessMachine; + USHORT Res0; + MACHINE_ATTRIBUTES MachineAttributes; +} PROCESS_MACHINE_INFORMATION; + typedef enum _PROCESS_INFORMATION_CLASS { ProcessMemoryPriority, @@ -2274,6 +2288,7 @@ WINBASEAPI BOOL WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR WINBASEAPI DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE); WINBASEAPI DWORD WINAPI GetProcessId(HANDLE); WINBASEAPI DWORD WINAPI GetProcessIdOfThread(HANDLE); +WINBASEAPI BOOL WINAPI GetProcessInformation(HANDLE,PROCESS_INFORMATION_CLASS,void*,DWORD); WINBASEAPI BOOL WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS); WINBASEAPI BOOL WINAPI GetProcessPriorityBoost(HANDLE,PBOOL); WINBASEAPI BOOL WINAPI GetProcessShutdownParameters(LPDWORD,LPDWORD);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=140839
Your paranoid android.
=== w8 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5327: Test failed: Unexpected attributes 0x591494. process.c:5331: Test failed: Unexpected attributes 0x591494.
=== w8adm (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5325: Test failed: Unexpected attributes 0x1861494. process.c:5327: Test failed: Unexpected attributes 0x1861494. process.c:5331: Test failed: Unexpected attributes 0x1861494.
=== w864 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5327: Test failed: Unexpected attributes 0xa9166c. process.c:5329: Test failed: Unexpected attributes 0xa9166c. process.c:5331: Test failed: Unexpected attributes 0xa9166c.
=== w1064v1507 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5327: Test failed: Unexpected attributes 0x7d1640. process.c:5329: Test failed: Unexpected attributes 0x7d1640. process.c:5331: Test failed: Unexpected attributes 0x7d1640.
=== w1064v1809 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5325: Test failed: Unexpected attributes 0x9d1cc0. process.c:5331: Test failed: Unexpected attributes 0x9d1cc0.
=== w1064_tsign (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5325: Test failed: Unexpected attributes 0x14a1cd4. process.c:5329: Test failed: Unexpected attributes 0x14a1cd4. process.c:5331: Test failed: Unexpected attributes 0x14a1cd4.
=== w10pro64 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5325: Test failed: Unexpected attributes 0x1aa1d3c. process.c:5329: Test failed: Unexpected attributes 0x1aa1d3c. process.c:5331: Test failed: Unexpected attributes 0x1aa1d3c.
=== w10pro64_en_AE_u8 (32 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x44. process.c:5325: Test failed: Unexpected attributes 0x1be1d3c. process.c:5329: Test failed: Unexpected attributes 0x1be1d3c. process.c:5331: Test failed: Unexpected attributes 0x1be1d3c.
=== w11pro64 (32 bit report) ===
kernel32: process.c:5324: Test failed: Unexpected process machine 0x14c.
=== w864 (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information.
=== w1064v1507 (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5318: Test failed: Failed to get architectures information.
=== w1064v1809 (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w1064_2qxl (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w1064_adm (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w1064_tsign (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w10pro64 (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w10pro64_ar (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w10pro64_ja (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.
=== w10pro64_zh_CN (64 bit report) ===
kernel32: process.c:5301: Test failed: Unexpected error 87. process.c:5304: Test failed: Unexpected error 87. process.c:5307: Test failed: Unexpected error 87. process.c:5310: Test failed: Unexpected error 87. process.c:5313: Test failed: Unexpected return value 0. process.c:5323: Test failed: Unexpected process machine 0x68. process.c:5325: Test failed: Unexpected attributes 0x5c0032. process.c:5331: Test failed: Unexpected attributes 0x5c0032.