Commit 89db25af authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Check for DLL files when creating new processes.

parent 6d5a6c34
......@@ -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 */
{
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment