start: Force no console creation when using start /exec.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-17 08:27:22 +01:00 committed by Alexandre Julliard
parent 7b65ef3afb
commit c7e87b536e
1 changed files with 5 additions and 2 deletions

View File

@ -516,8 +516,11 @@ int __cdecl wmain (int argc, WCHAR *argv[])
break;
}
else if (is_option(argv[i], L"/exec")) {
creation_flags = 0;
sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE | SEE_MASK_FLAG_NO_UI;
/* If start.exe isn't attached to a console, force that no console would be created.
* This is needed when target process belongs to CUI subsystem.
*/
creation_flags = GetConsoleCP() == 0 ? DETACHED_PROCESS : 0;
sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE | SEE_MASK_FLAG_NO_UI;
i++;
break;
}