Module: wine Branch: master Commit: 1b447409cb83e1ebc6037fadbca309c304055ade URL: https://source.winehq.org/git/wine.git/?a=commit;h=1b447409cb83e1ebc6037fadb...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Dec 2 11:23:16 2021 +0100
ntdll: Set the TEB offset for Wow64 mode also in 64-bit.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/unix/env.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ca3e0a9dc81..30d8ac1553c 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -2128,6 +2128,15 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module ) peb->ImageSubSystemMajorVersion = main_image_info.MajorSubsystemVersion; peb->ImageSubSystemMinorVersion = main_image_info.MinorSubsystemVersion;
+#ifdef _WIN64 + if (main_image_info.Machine != current_machine) + { + NtCurrentTeb()->WowTebOffset = teb_offset; + NtCurrentTeb()->Tib.ExceptionList = (void *)((char *)NtCurrentTeb() + teb_offset); + set_thread_id( NtCurrentTeb(), GetCurrentProcessId(), GetCurrentThreadId() ); + } +#endif + load_global_options( ¶ms->ImagePathName );
if (NtCurrentTeb()->WowTebOffset)