[ros-diffs] [gvg] 13501: Check subsystem

gvg at svn.reactos.com gvg at svn.reactos.com
Sat Feb 12 10:17:53 CET 2005


Check subsystem
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-12 09:08:52 UTC
(rev 13500)
+++ trunk/reactos/lib/kernel32/process/create.c	2005-02-12 09:17:51 UTC
(rev 13501)
@@ -1023,6 +1023,7 @@

    if (! NT_SUCCESS(Status))
    {
      NtClose(hSection);
+     DPRINT("Unable to get SectionImageInformation, status 0x%x\n",
Status);
      SetLastErrorByStatus(Status);
      return FALSE;
    }
@@ -1030,10 +1031,20 @@
    if (0 != (Sii.Characteristics & IMAGE_FILE_DLL))
    {
      NtClose(hSection);
+     DPRINT("Can't execute a DLL\n");
      SetLastError(ERROR_BAD_EXE_FORMAT);
      return FALSE;
    }
 
+   if (IMAGE_SUBSYSTEM_WINDOWS_GUI != Sii.Subsystem
+       && IMAGE_SUBSYSTEM_WINDOWS_CUI != Sii.Subsystem)
+   {
+     NtClose(hSection);
+     DPRINT("Invalid subsystem %d\n", Sii.Subsystem);
+     SetLastError(ERROR_CHILD_NOT_COMPLETE);
+     return FALSE;
+   }
+
    /*
     * Initialize the process object attributes
     */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050212/5d2ef2e3/attachment.html


More information about the Ros-diffs mailing list