Module: wine Branch: master Commit: d5a499e552d0f2c75922ae1089f7d2c78464d5ed URL: https://gitlab.winehq.org/wine/wine/-/commit/d5a499e552d0f2c75922ae1089f7d2c...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jun 11 10:29:19 2024 +0200
ntdll: Look for hybrid builtins in the PE directory for the host architecture.
---
dlls/ntdll/unix/loader.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 9d866fa70f5..8cf6abed3da 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1283,6 +1283,7 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, USHOR { NTSTATUS status; UNICODE_STRING nt_name; + USHORT search_machine = image_info->machine; enum loadorder loadorder;
init_unicode_string( &nt_name, filename ); @@ -1302,6 +1303,9 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, USHOR loadorder = LO_BUILTIN; /* builtin with no fallback since mapping a fake dll is not useful */ }
+ if (is_arm64ec() && image_info->is_hybrid && search_machine == IMAGE_FILE_MACHINE_AMD64) + search_machine = current_machine; + switch (loadorder) { case LO_NATIVE: @@ -1309,10 +1313,10 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, USHOR return STATUS_IMAGE_ALREADY_LOADED; case LO_BUILTIN: return find_builtin_dll( &nt_name, module, size, info, limit_low, limit_high, - image_info->machine, machine, FALSE ); + search_machine, machine, FALSE ); default: status = find_builtin_dll( &nt_name, module, size, info, limit_low, limit_high, - image_info->machine, machine, (loadorder == LO_DEFAULT) ); + search_machine, machine, (loadorder == LO_DEFAULT) ); if (status == STATUS_DLL_NOT_FOUND || status == STATUS_NOT_SUPPORTED) return STATUS_IMAGE_ALREADY_LOADED; return status;