Check subsystem

svn path=/trunk/; revision=13501
This commit is contained in:
Gé van Geldorp 2005-02-12 09:17:51 +00:00
parent 3cc5374fe1
commit 18e42fda45

View file

@ -1023,6 +1023,7 @@ CreateProcessW
if (! NT_SUCCESS(Status))
{
NtClose(hSection);
DPRINT("Unable to get SectionImageInformation, status 0x%x\n", Status);
SetLastErrorByStatus(Status);
return FALSE;
}
@ -1030,10 +1031,20 @@ CreateProcessW
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
*/