ntdll: Unmap main image even if not loaded at base address.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50874
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-03-29 12:19:59 +02:00
parent aab6ebb734
commit b12bf4d8d8
1 changed files with 1 additions and 1 deletions

View File

@ -1872,7 +1872,7 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params(void)
env[env_pos++] = 0;
status = load_main_exe( main_wargv[0], main_argv[0], curdir, &image, &module, &image_info );
if (!status && image_info.Machine != current_machine) /* need to restart for Wow64 */
if (status >= 0 && image_info.Machine != current_machine) /* need to restart for Wow64 */
{
NtUnmapViewOfSection( GetCurrentProcess(), module );
status = STATUS_INVALID_IMAGE_FORMAT;