Skip to content

Commit 98f292e

Browse files
authored
Merge pull request #1448 from mlandolfi90/fix/hide-daemon-child-windows
fix(windows): hide the console windows of spawned child processes
2 parents 8042aa8 + 9354930 commit 98f292e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/foundation/compat_fs.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,9 @@ static FILE *cbm_popen_isolated(const char *cmd, const char **stage, DWORD *gle)
310310
*stage = "cmdline";
311311
*gle = ERROR_NOT_ENOUGH_MEMORY;
312312
} else {
313-
created = CreateProcessW(app, wcmdline, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT,
314-
NULL, NULL, &si.StartupInfo, &pi);
313+
created = CreateProcessW(app, wcmdline, NULL, NULL, TRUE,
314+
EXTENDED_STARTUPINFO_PRESENT | CREATE_NO_WINDOW, NULL, NULL,
315+
&si.StartupInfo, &pi);
315316
if (!created) {
316317
*stage = "spawn";
317318
*gle = GetLastError();

‎src/foundation/subprocess.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,8 @@ static int cbm_subprocess_spawn_win(cbm_subprocess_t *process) {
734734

735735
PROCESS_INFORMATION child;
736736
ZeroMemory(&child, sizeof(child));
737-
DWORD flags = EXTENDED_STARTUPINFO_PRESENT | CREATE_SUSPENDED | CREATE_NEW_PROCESS_GROUP;
737+
DWORD flags = EXTENDED_STARTUPINFO_PRESENT | CREATE_SUSPENDED | CREATE_NEW_PROCESS_GROUP |
738+
CREATE_NO_WINDOW;
738739
BOOL created = CreateProcessW(wbin, wcmdline, NULL, NULL, TRUE, flags, NULL, NULL,
739740
&startup.StartupInfo, &child);
740741
cbm_win_close_spawn_handles(nul, log, attrs, attrs_init);

0 commit comments

Comments
 (0)