Alexandre Julliard : wow64: Make the syscall dispatcher point to the wow64cpu syscall wrapper.

Alexandre Julliard julliard at winehq.org
Wed Aug 4 16:41:37 CDT 2021


Module: wine
Branch: master
Commit: 9f24bc44bcb5e147e46a74de4e8d570641aa1377
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9f24bc44bcb5e147e46a74de4e8d570641aa1377

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug  4 12:06:27 2021 +0200

wow64: Make the syscall dispatcher point to the wow64cpu syscall wrapper.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wow64/syscall.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c
index 2fd9f309b1b..e120ed022cd 100644
--- a/dlls/wow64/syscall.c
+++ b/dlls/wow64/syscall.c
@@ -62,8 +62,16 @@ struct mem_header
     BYTE               data[1];
 };
 
+static void **pWow64Transition;
+static void **p__wine_syscall_dispatcher;
 static SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock;
 
+/* cpu backend dll functions */
+static void *   (WINAPI *pBTCpuGetBopCode)(void);
+static void     (WINAPI *pBTCpuProcessInit)(void);
+static void     (WINAPI *pBTCpuSimulate)(void);
+
+
 void *dummy = RtlUnwind;
 
 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
@@ -400,9 +408,17 @@ static void process_init(void)
     GET_PTR( LdrSystemDllInitBlock );
 
     module = (HMODULE)(ULONG_PTR)pLdrSystemDllInitBlock->ntdll_handle;
+    GET_PTR( Wow64Transition );
+    GET_PTR( __wine_syscall_dispatcher );
     init_syscall_table( module );
 
-    load_cpu_dll();
+    module = load_cpu_dll();
+    GET_PTR( BTCpuGetBopCode );
+    GET_PTR( BTCpuProcessInit );
+    GET_PTR( BTCpuSimulate );
+
+    pBTCpuProcessInit();
+    *pWow64Transition = *p__wine_syscall_dispatcher = pBTCpuGetBopCode();
 
     init_file_redirects();
 




More information about the wine-cvs mailing list