Module: wine Branch: master Commit: 679a2f531bdba5a1abbf9db44f1d0defd8a945a0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=679a2f531bdba5a1abbf9db44...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Dec 2 09:59:13 2021 +0100
ntdll: Don't try to convert binaries to 64-bit in Wow64 mode.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/loader.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 86aec79dbfc..665c4480ad4 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2118,6 +2118,7 @@ static BOOL convert_to_pe64( HMODULE module, const SECTION_IMAGE_INFORMATION *in ULONG i, old_prot;
if (nt->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) return TRUE; /* already 64-bit */ + if (NtCurrentTeb()->WowTebOffset) return TRUE; /* no need to convert */ if (!info->ImageContainsCode) return TRUE; /* no need to convert */
TRACE( "%p\n", module ); @@ -2207,6 +2208,7 @@ static BOOL is_valid_binary( HANDLE file, const SECTION_IMAGE_INFORMATION *info #else if (info->Machine == IMAGE_FILE_MACHINE_ARM64) return TRUE; #endif + if (NtCurrentTeb()->WowTebOffset) return TRUE; if (!info->ImageContainsCode) return TRUE; if (!(info->u.s.ComPlusNativeReady)) {