From 183a36f0fb2e24038c4b4ed4ab9cb3e08dd6187d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Tue, 8 Feb 2005 22:11:27 +0000 Subject: [PATCH] You can't execute a DLL svn path=/trunk/; revision=13469 --- reactos/lib/kernel32/process/create.c | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index 4c0c0c48d5c..72f08276c0a 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -1011,6 +1011,29 @@ CreateProcessW lpProcessInformation); } ///////////////////////////////////////// + + /* + * Get some information about the executable + */ + Status = ZwQuerySection(hSection, + SectionImageInformation, + &Sii, + sizeof(Sii), + &i); + if (! NT_SUCCESS(Status)) + { + NtClose(hSection); + SetLastErrorByStatus(Status); + return FALSE; + } + + if (0 != (Sii.Characteristics & IMAGE_FILE_DLL)) + { + NtClose(hSection); + SetLastError(ERROR_BAD_EXE_FORMAT); + return FALSE; + } + /* * Initialize the process object attributes */ @@ -1133,16 +1156,6 @@ CreateProcessW DUPLICATE_SAME_ACCESS); /* FIXME - handle failure!!!!! */ } - - /* - * Get some information about the executable - */ - Status = ZwQuerySection(hSection, - SectionImageInformation, - &Sii, - sizeof(Sii), - &i); - /* FIXME - handle failure!!!!! */ /* * Close the section