Module: wine Branch: master Commit: c1295953816e6b071e6ad0e58f142a3b5f74574c URL: https://gitlab.winehq.org/wine/wine/-/commit/c1295953816e6b071e6ad0e58f142a3...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Feb 7 19:07:40 2024 +0100
ntdll: Use the correct machine when loading ntdll on ARM64EC.
---
dlls/ntdll/unix/loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 662ec5ef7a8..05284115b67 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1641,6 +1641,7 @@ static void load_ntdll(void) static WCHAR path[] = {'\','?','?','\','C',':','\','w','i','n','d','o','w','s','\', 's','y','s','t','e','m','3','2','\','n','t','d','l','l','.','d','l','l',0}; const char *pe_dir = get_pe_dir( current_machine ); + USHORT machine = current_machine; unsigned int status; SECTION_IMAGE_INFORMATION info; OBJECT_ATTRIBUTES attr; @@ -1654,7 +1655,9 @@ static void load_ntdll(void)
if (build_dir) asprintf( &name, "%s%s/ntdll.dll", ntdll_dir, pe_dir ); else asprintf( &name, "%s%s/ntdll.dll", dll_dir, pe_dir ); - status = open_builtin_pe_file( name, &attr, &module, &size, &info, 0, 0, current_machine, FALSE ); + + if (is_arm64ec()) machine = main_image_info.Machine; + status = open_builtin_pe_file( name, &attr, &module, &size, &info, 0, 0, machine, FALSE ); if (status == STATUS_DLL_NOT_FOUND) { free( name );