Commit 7686cba1 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: One more fix for CPU information in old Wow64 mode.

parent 75ab8431
......@@ -322,7 +322,6 @@ static void test_query_cpu(void)
{
ok( sci.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL, "ProcessorArchitecture wrong %x\n",
sci.ProcessorArchitecture );
todo_wine
ok( sci2.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
sci2.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64,
"ProcessorArchitecture wrong %x\n", sci2.ProcessorArchitecture );
......
......@@ -2568,14 +2568,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
}
case SystemCpuInformation: /* 1 */
if (size >= (len = sizeof(cpu_info)))
{
SYSTEM_CPU_INFORMATION cpu = cpu_info;
if (is_old_wow64() && cpu.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
cpu.ProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64;
memcpy(info, &cpu, len);
}
if (size >= (len = sizeof(cpu_info))) memcpy(info, &cpu_info, len);
else ret = STATUS_INFO_LENGTH_MISMATCH;
break;
......
......@@ -5319,10 +5319,21 @@ NTSTATUS WINAPI NtWow64WriteVirtualMemory64( HANDLE process, ULONG64 addr, const
NTSTATUS WINAPI NtWow64GetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, void *info,
ULONG len, ULONG *retlen )
{
NTSTATUS status;
switch (class)
{
case SystemBasicInformation:
case SystemCpuInformation:
status = NtQuerySystemInformation( class, info, len, retlen );
if (!status && is_old_wow64())
{
SYSTEM_CPU_INFORMATION *cpu = info;
if (cpu->ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
cpu->ProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64;
}
return status;
case SystemBasicInformation:
case SystemEmulationBasicInformation:
case SystemEmulationProcessorInformation:
return NtQuerySystemInformation( class, info, len, retlen );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment