[ros-diffs] [gvg] 13469: You can't execute a DLL

gvg at svn.reactos.com gvg at svn.reactos.com
Tue Feb 8 23:11:29 CET 2005


You can't execute a DLL
Modified: trunk/reactos/lib/kernel32/process/create.c
  _____  

Modified: trunk/reactos/lib/kernel32/process/create.c
--- trunk/reactos/lib/kernel32/process/create.c	2005-02-08 21:27:49 UTC
(rev 13468)
+++ trunk/reactos/lib/kernel32/process/create.c	2005-02-08 22:11:27 UTC
(rev 13469)
@@ -1011,7 +1011,30 @@

 	         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 @@
 			 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050208/74f14f46/attachment.html


More information about the Ros-diffs mailing list