[PATCH] wineboot: Fix PROCESSOR_ARCHITECTURE reg value
Brendan McGrath
brendan at redmandi.com
Fri Feb 8 22:06:29 CST 2019
On my Windows machine, PROCESSOR_ARCHITECTURE has the value "AMD64",
but under wine (since 4.1) the value is "Intel64".
It appears some games implement the Detection Logic defined here:
https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/
That is, they expect PROCESSOR_ARCHITECTURE to be AMD64 for 64-bit machines.
This patch ensures the PROCESSOR_ARCHITECTURE and PROCESSOR_IDENTIFIER are the
same in wine as they are in Windows.
For example, on my machine this is:
"PROCESSOR_ARCHITECTURE"="AMD64"
"PROCESSOR_IDENTIFIER"="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
Signed-off-by: Brendan McGrath <brendan at redmandi.com>
---
programs/wineboot/wineboot.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 32e4225491..b85a3b6b6e 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -422,7 +422,7 @@ static void create_environment_registry_keys( void )
HKEY env_key;
SYSTEM_CPU_INFORMATION sci;
WCHAR buffer[60], vendorid[13];
- const WCHAR *arch;
+ const WCHAR *arch, *parch;
if (RegCreateKeyW( HKEY_LOCAL_MACHINE, EnvironW, &env_key )) return;
@@ -435,12 +435,13 @@ static void create_environment_registry_keys( void )
switch (sci.Architecture)
{
case PROCESSOR_ARCHITECTURE_AMD64:
- arch = !strcmpW(vendorid, authenticamdW) ? amd64W : intel64W;
+ arch = amd64W;
+ parch = !strcmpW(vendorid, authenticamdW) ? amd64W : intel64W;
break;
case PROCESSOR_ARCHITECTURE_INTEL:
default:
- arch = x86W;
+ arch = parch = x86W;
break;
}
set_reg_value( env_key, ProcArchW, arch );
@@ -455,7 +456,7 @@ static void create_environment_registry_keys( void )
case PROCESSOR_ARCHITECTURE_AMD64:
case PROCESSOR_ARCHITECTURE_INTEL:
default:
- get_identifier( buffer, arch );
+ get_identifier( buffer, parch );
strcatW( buffer, commaW );
strcatW( buffer, vendorid );
break;
--
2.17.1
More information about the wine-devel
mailing list