diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ab2e828dacd..5b4a2254659 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1917,7 +1917,11 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params(void) env[env_pos++] = 0; status = load_main_exe( NULL, main_argv[1], curdir, &image, &module, &image_info ); - if (!status && image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; + if (!status) + { + if (image_info.ImageCharacteristics & IMAGE_FILE_DLL) status = STATUS_INVALID_IMAGE_FORMAT; + if (image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; + } if (status) /* try launching it through start.exe */ { diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index b020e15eaee..54410261c91 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -365,6 +365,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, HANDLE *handle, pe_image } SERVER_END_REQ; NtClose( mapping ); + if (info->image_charact & IMAGE_FILE_DLL) return STATUS_INVALID_IMAGE_FORMAT; } else if (status == STATUS_INVALID_IMAGE_NOT_MZ) {