From 44de9743bfeb088b0aa038da82ba118ce4ab30a4 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 4 Aug 2021 12:42:44 +0200 Subject: [PATCH] ntdll: Store the 32-bit PEB in the process initial 32-bit context. Signed-off-by: Alexandre Julliard --- dlls/ntdll/unix/signal_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 2769ebf24d6..bfc5b34a464 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2929,7 +2929,7 @@ void DECLSPEC_HIDDEN call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, B { wow_context->ContextFlags = CONTEXT_I386_ALL; wow_context->Eax = (ULONG_PTR)entry; - wow_context->Ebx = (ULONG_PTR)arg; + wow_context->Ebx = (arg == peb ? get_wow_teb( teb )->Peb : (ULONG_PTR)arg); wow_context->Esp = get_wow_teb( teb )->Tib.StackBase - 16; wow_context->Eip = pLdrSystemDllInitBlock->pRtlUserThreadStart; wow_context->SegCs = cs32_sel;