[PATCH 0/2] MR4924: ntdll: Fix +relay for apps using multiple threads on Wow64.
This was broken by commit a1830c03a50ad38ec3f857a2a8b88498d1bf5e54 ("ntdll: Add a separate helper to build the main module on Wow64."). `init_wow64()` is called on thread creation, and each new thread was re-creating the main module and `ntdll`. `+relay` seemed to be the only functionality broken by this. That commit also made a helper which calls `NtQueryVirtualMemory(LdrInitializeThunk,MemoryBasicInformation)`, but didn't remove the original call. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4924
From: Brendan Shanks <bshanks(a)codeweavers.com> --- dlls/ntdll/loader.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 021f7941969..8030e3b7892 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4255,14 +4255,10 @@ void loader_init( CONTEXT *context, void **entry ) if (!imports_fixup_done) { - MEMORY_BASIC_INFORMATION meminfo; ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; - NtQueryVirtualMemory( GetCurrentProcess(), LdrInitializeThunk, MemoryBasicInformation, - &meminfo, sizeof(meminfo), NULL ); - peb->LdrData = &ldr; peb->FastPebLock = &peb_lock; peb->TlsBitmap = &tls_bitmap; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4924
From: Brendan Shanks <bshanks(a)codeweavers.com> Fixes +relay for applications that use multiple threads when running in new Wow64. --- dlls/ntdll/loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8030e3b7892..4fc8af2662e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4131,9 +4131,6 @@ void (WINAPI *pWow64PrepareForException)( EXCEPTION_RECORD *rec, CONTEXT *contex static void init_wow64( CONTEXT *context ) { - build_wow64_main_module(); - build_ntdll_module(); - if (!imports_fixup_done) { HMODULE wow64; @@ -4141,6 +4138,9 @@ static void init_wow64( CONTEXT *context ) NTSTATUS status; static const WCHAR wow64_path[] = L"C:\\windows\\system32\\wow64.dll"; + build_wow64_main_module(); + build_ntdll_module(); + if ((status = load_dll( NULL, wow64_path, 0, &wm, FALSE ))) { ERR( "could not load %s, status %lx\n", debugstr_w(wow64_path), status ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4924
participants (2)
-
Brendan Shanks -
Brendan Shanks (@bshanks)