ntdll: Consistently fixup the machine type for IL-only binaries.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51668
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-08-24 17:39:58 +02:00
parent c0198a6561
commit 88c5184b4d
2 changed files with 5 additions and 3 deletions

View file

@ -2148,8 +2148,6 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module )
if (!status)
{
if (main_image_info.ImageCharacteristics & IMAGE_FILE_DLL) status = STATUS_INVALID_IMAGE_FORMAT;
if (main_image_info.ImageFlags & IMAGE_FLAGS_ComPlusNativeReady)
main_image_info.Machine = native_machine;
if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT;
}

View file

@ -1569,7 +1569,11 @@ static NTSTATUS open_main_image( WCHAR *image, void **module, SECTION_IMAGE_INFO
*module = NULL;
status = NtMapViewOfSection( mapping, NtCurrentProcess(), module, 0, 0, NULL, &size,
ViewShare, 0, PAGE_EXECUTE_READ );
if (!status) NtQuerySection( mapping, SectionImageInformation, info, sizeof(*info), NULL );
if (!status)
{
NtQuerySection( mapping, SectionImageInformation, info, sizeof(*info), NULL );
if (info->u.s.ComPlusNativeReady) info->Machine = native_machine;
}
NtClose( mapping );
}
else if (status == STATUS_INVALID_IMAGE_NOT_MZ && loadorder != LO_NATIVE)