From d41117b61ed3ccc34900c76611f6ce7b534521ce Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 22 Mar 2023 13:20:00 +0100 Subject: [PATCH] wow64: Allow the CPU backend to override CPU information. --- dlls/wow64/syscall.c | 3 ++- dlls/wow64/system.c | 4 +++- dlls/wow64/wow64_private.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index d057fcc256e..06dd9822a08 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -110,7 +110,7 @@ static void (WINAPI *pBTCpuSimulate)(void); static NTSTATUS (WINAPI *pBTCpuResetToConsistentState)( EXCEPTION_POINTERS * ); static void * (WINAPI *p__wine_get_unix_opcode)(void); static void * (WINAPI *pKiRaiseUserExceptionDispatcher)(void); - +void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) = NULL; void *dummy = RtlUnwind; @@ -842,6 +842,7 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex GET_PTR( BTCpuResetToConsistentState ); GET_PTR( BTCpuSetContext ); GET_PTR( BTCpuSimulate ); + GET_PTR( BTCpuUpdateProcessorInformation ); GET_PTR( __wine_get_unix_opcode ); module = load_64bit_module( L"wow64win.dll" ); diff --git a/dlls/wow64/system.c b/dlls/wow64/system.c index 5d111cc942d..21e191b8a29 100644 --- a/dlls/wow64/system.c +++ b/dlls/wow64/system.c @@ -337,7 +337,9 @@ NTSTATUS WINAPI wow64_NtQuerySystemInformation( UINT *args ) case SystemCpuInformation: /* SYSTEM_CPU_INFORMATION */ case SystemEmulationProcessorInformation: /* SYSTEM_CPU_INFORMATION */ - return NtQuerySystemInformation( SystemEmulationProcessorInformation, ptr, len, retlen ); + status = NtQuerySystemInformation( SystemEmulationProcessorInformation, ptr, len, retlen ); + if (!status && pBTCpuUpdateProcessorInformation) pBTCpuUpdateProcessorInformation( ptr ); + return status; case SystemBasicInformation: /* SYSTEM_BASIC_INFORMATION */ case SystemEmulationBasicInformation: /* SYSTEM_BASIC_INFORMATION */ diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index 7eef4da3ad9..bba191ad439 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -38,6 +38,7 @@ extern ULONG_PTR args_alignment DECLSPEC_HIDDEN; extern ULONG_PTR highest_user_address DECLSPEC_HIDDEN; extern ULONG_PTR default_zero_bits DECLSPEC_HIDDEN; extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN; +extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) DECLSPEC_HIDDEN; struct object_attr64 {