Detach GUI process from console

svn path=/trunk/; revision=20264
This commit is contained in:
Gé van Geldorp 2005-12-18 23:21:58 +00:00
parent b414f7c09f
commit 37b1fdddf8

View file

@ -1107,6 +1107,13 @@ GetAppName:
SetLastError(ERROR_BAD_EXE_FORMAT);
goto Cleanup;
}
if (IMAGE_SUBSYSTEM_WINDOWS_GUI == SectionImageInfo.SubsystemType)
{
/* Do not create a console for GUI applications */
dwCreationFlags &= ~CREATE_NEW_CONSOLE;
dwCreationFlags |= DETACHED_PROCESS;
}
/* Initialize the process object attributes */
ObjectAttributes = BasepConvertObjectAttributes(&LocalObjectAttributes,
@ -1332,7 +1339,6 @@ GetAppName:
goto Cleanup;
}
/* Notify CSRSS */
Status = BasepNotifyCsrOfCreation(dwCreationFlags,
(HANDLE)ProcessBasicInfo.UniqueProcessId,