2019-04-22 16:04:10 -07:00
|
|
|
From bee8746cd94c609317194df846542a4a4ce8330a Mon Sep 17 00:00:00 2001
|
2018-08-08 20:57:52 -07:00
|
|
|
From: Zebediah Figura <z.figura12@gmail.com>
|
|
|
|
Date: Wed, 8 Aug 2018 20:00:15 -0500
|
2019-02-14 16:18:02 -08:00
|
|
|
Subject: [PATCH] ntdll: Add a stub implementation of Wow64Transition.
|
2018-08-08 20:57:52 -07:00
|
|
|
|
|
|
|
---
|
2019-02-08 19:57:06 -08:00
|
|
|
dlls/ntdll/loader.c | 11 ++++++++++-
|
2018-12-10 17:48:41 -08:00
|
|
|
dlls/ntdll/ntdll.spec | 1 +
|
2019-02-08 19:57:06 -08:00
|
|
|
2 files changed, 11 insertions(+), 1 deletion(-)
|
2018-08-08 20:57:52 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
2019-04-22 16:04:10 -07:00
|
|
|
index 5c75f0c..f4eac57 100644
|
2018-08-08 20:57:52 -07:00
|
|
|
--- a/dlls/ntdll/loader.c
|
|
|
|
+++ b/dlls/ntdll/loader.c
|
2019-04-22 16:04:10 -07:00
|
|
|
@@ -3889,18 +3889,20 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
2018-08-08 20:57:52 -07:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
+void *Wow64Transition;
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* __wine_process_init
|
|
|
|
*/
|
|
|
|
void __wine_process_init(void)
|
|
|
|
{
|
|
|
|
+ static const WCHAR wow64cpuW[] = {'w','o','w','6','4','c','p','u','.','d','l','l',0};
|
2019-04-22 16:04:10 -07:00
|
|
|
static const WCHAR kernel32W[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
|
|
|
|
's','y','s','t','e','m','3','2','\\',
|
|
|
|
'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
2019-02-14 16:18:02 -08:00
|
|
|
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
|
|
|
|
ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
|
2018-08-08 20:57:52 -07:00
|
|
|
- WINE_MODREF *wm;
|
|
|
|
+ WINE_MODREF *wm, *wow64cpu_wm;
|
|
|
|
NTSTATUS status;
|
|
|
|
ANSI_STRING func_name;
|
2019-02-08 19:57:06 -08:00
|
|
|
UNICODE_STRING nt_name;
|
2019-04-22 16:04:10 -07:00
|
|
|
@@ -3928,6 +3930,13 @@ void __wine_process_init(void)
|
2018-12-10 17:48:41 -08:00
|
|
|
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
+
|
2019-02-08 19:57:06 -08:00
|
|
|
+ RtlInitUnicodeString( &nt_name, wow64cpuW );
|
|
|
|
+ if ((status = load_builtin_dll( NULL, &nt_name, 0, 0, &wow64cpu_wm )) == STATUS_SUCCESS)
|
2018-08-08 20:57:52 -07:00
|
|
|
+ Wow64Transition = wow64cpu_wm->ldr.BaseAddress;
|
|
|
|
+ else
|
|
|
|
+ WARN( "could not load wow64cpu.dll, status %#x\n", status );
|
|
|
|
+
|
2018-12-10 17:48:41 -08:00
|
|
|
RtlInitAnsiString( &func_name, "__wine_kernel_init" );
|
|
|
|
if ((status = LdrGetProcedureAddress( wm->ldr.BaseAddress, &func_name,
|
|
|
|
0, (void **)&init_func )) != STATUS_SUCCESS)
|
2018-08-08 20:57:52 -07:00
|
|
|
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
2019-04-22 16:04:10 -07:00
|
|
|
index 415e868..343ab66 100644
|
2018-08-08 20:57:52 -07:00
|
|
|
--- a/dlls/ntdll/ntdll.spec
|
|
|
|
+++ b/dlls/ntdll/ntdll.spec
|
2019-02-08 19:57:06 -08:00
|
|
|
@@ -1048,6 +1048,7 @@
|
2018-08-08 20:57:52 -07:00
|
|
|
@ stdcall WinSqmIsOptedIn()
|
|
|
|
@ stdcall WinSqmSetDWORD(ptr long long)
|
|
|
|
@ stdcall WinSqmStartSession(ptr long long)
|
|
|
|
+@ extern Wow64Transition
|
|
|
|
@ stdcall -private ZwAcceptConnectPort(ptr long ptr long ptr ptr) NtAcceptConnectPort
|
|
|
|
@ stdcall -private ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck
|
|
|
|
@ stdcall -private ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm
|
|
|
|
--
|
2019-02-14 16:18:02 -08:00
|
|
|
1.9.1
|
2018-08-08 20:57:52 -07:00
|
|
|
|