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