2020-12-04 15:25:39 -08:00
|
|
|
From cacb65b29f688766745372653bd406116e87ee87 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
|
|
|
|
|
|
|
---
|
2020-08-24 19:21:59 -07:00
|
|
|
dlls/ntdll/loader.c | 10 +++++++++-
|
2018-12-10 17:48:41 -08:00
|
|
|
dlls/ntdll/ntdll.spec | 1 +
|
2020-08-24 19:21:59 -07:00
|
|
|
2 files changed, 10 insertions(+), 1 deletion(-)
|
2018-08-08 20:57:52 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
2020-12-04 15:25:39 -08:00
|
|
|
index 4ededa838b4..b0c4853ca48 100644
|
2018-08-08 20:57:52 -07:00
|
|
|
--- a/dlls/ntdll/loader.c
|
|
|
|
+++ b/dlls/ntdll/loader.c
|
2020-12-04 15:25:39 -08:00
|
|
|
@@ -4109,6 +4109,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
2020-07-20 17:55:28 -07:00
|
|
|
return TRUE;
|
2018-08-08 20:57:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
+void *Wow64Transition;
|
|
|
|
|
|
|
|
/***********************************************************************
|
2020-09-02 15:40:02 -07:00
|
|
|
* restart_winevdm
|
2020-12-04 15:25:39 -08:00
|
|
|
@@ -4139,7 +4140,7 @@ static void restart_winevdm( RTL_USER_PROCESS_PARAMETERS *params )
|
|
|
|
static NTSTATUS process_init(void)
|
|
|
|
{
|
2019-11-07 15:13:27 -08:00
|
|
|
RTL_USER_PROCESS_PARAMETERS *params;
|
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;
|
2020-12-04 15:25:39 -08:00
|
|
|
@@ -4201,6 +4202,13 @@ static NTSTATUS process_init(void)
|
2018-12-10 17:48:41 -08:00
|
|
|
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
|
2020-06-29 16:56:48 -07:00
|
|
|
NtTerminateProcess( GetCurrentProcess(), status );
|
2018-12-10 17:48:41 -08:00
|
|
|
}
|
|
|
|
+
|
2020-08-24 19:21:59 -07:00
|
|
|
+ RtlInitUnicodeString( &nt_name, L"\\??\\C:\\windows\\system32\\wow64cpu.dll" );
|
2021-01-25 20:37:12 -08:00
|
|
|
+ if ((status = load_builtin_dll( NULL, &nt_name, 0, &wow64cpu_wm )) == STATUS_SUCCESS)
|
2020-04-24 14:35:33 -07:00
|
|
|
+ Wow64Transition = wow64cpu_wm->ldr.DllBase;
|
2018-08-08 20:57:52 -07:00
|
|
|
+ else
|
|
|
|
+ WARN( "could not load wow64cpu.dll, status %#x\n", status );
|
|
|
|
+
|
2020-09-02 07:38:53 -07:00
|
|
|
RtlInitAnsiString( &func_name, "BaseThreadInitThunk" );
|
2020-04-24 14:35:33 -07:00
|
|
|
if ((status = LdrGetProcedureAddress( wm->ldr.DllBase, &func_name,
|
2020-09-02 07:38:53 -07:00
|
|
|
0, (void **)&pBaseThreadInitThunk )) != STATUS_SUCCESS)
|
2018-08-08 20:57:52 -07:00
|
|
|
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
2020-12-04 15:25:39 -08:00
|
|
|
index aa34fdf04d9..34cdeaa1479 100644
|
2018-08-08 20:57:52 -07:00
|
|
|
--- a/dlls/ntdll/ntdll.spec
|
|
|
|
+++ b/dlls/ntdll/ntdll.spec
|
2020-12-04 15:25:39 -08:00
|
|
|
@@ -1130,6 +1130,7 @@
|
2018-08-08 20:57:52 -07:00
|
|
|
@ stdcall WinSqmIsOptedIn()
|
|
|
|
@ stdcall WinSqmSetDWORD(ptr long long)
|
|
|
|
@ stdcall WinSqmStartSession(ptr long long)
|
|
|
|
+@ extern Wow64Transition
|
2020-07-20 17:55:28 -07:00
|
|
|
@ stdcall -private -syscall ZwAcceptConnectPort(ptr long ptr long ptr ptr) NtAcceptConnectPort
|
|
|
|
@ stdcall -private -syscall ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck
|
|
|
|
@ stdcall -private -syscall ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm
|
2018-08-08 20:57:52 -07:00
|
|
|
--
|
2020-12-04 15:25:39 -08:00
|
|
|
2.29.2
|
2018-08-08 20:57:52 -07:00
|
|
|
|