Commit f034084d authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernelbase: Handle corner case in CreateProcess.

In CreateProcess, if: - parent isn't attached to a console - CreateProcess's flag isn't set with DETACHED_PROCESS nor CREATE_NEW_CONSOLE - child is a CUI program then a console must be allocated for the child. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52048Signed-off-by: 's avatarEric Pouech <eric.pouech@gmail.com> Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c7e87b53
......@@ -4735,7 +4735,7 @@ static void test_CreateProcessCUI(void)
res = check_whether_child_attached(cuiexec, DETACHED_PROCESS);
ok(!res, "Don't expecting child to be attached to a console\n");
res = check_whether_child_attached(cuiexec, 0);
todo_wine ok(res, "Expecting child to be attached to a console\n");
ok(res, "Expecting child to be attached to a console\n");
DeleteFileA(guiexec);
DeleteFileA(cuiexec);
......
......@@ -191,7 +191,11 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
if (flags & CREATE_NEW_PROCESS_GROUP) params->ConsoleFlags = 1;
if (flags & CREATE_NEW_CONSOLE) params->ConsoleHandle = CONSOLE_HANDLE_ALLOC;
else if (!(flags & DETACHED_PROCESS)) params->ConsoleHandle = NtCurrentTeb()->Peb->ProcessParameters->ConsoleHandle;
else if (!(flags & DETACHED_PROCESS))
{
params->ConsoleHandle = NtCurrentTeb()->Peb->ProcessParameters->ConsoleHandle;
if (!params->ConsoleHandle) params->ConsoleHandle = CONSOLE_HANDLE_ALLOC;
}
if (startup->dwFlags & STARTF_USESTDHANDLES)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment