From: Stanislav Malyshev Date: Mon, 2 Apr 2007 20:44:30 +0000 (+0000) Subject: fix for #33664 Console window appears when using exec() X-Git-Tag: php-5.2.2RC1~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f0d69159e0a1ed44f93e06cab5905ddba310eef;p=php fix for #33664 Console window appears when using exec() --- diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 5a8983b5e4..ae9ea312f2 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -219,7 +219,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")); sprintf(cmd, "%s /c %s", TWG(comspec), command); - if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, env, cwd, &startup, &process)) { + if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) { return NULL; } free(cmd); diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 26f4a6fc8a..2fc8e6eae8 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -745,11 +745,11 @@ PHP_FUNCTION(proc_open) } if (bypass_shell) { - newprocok = CreateProcess(NULL, command, &security, &security, TRUE, NORMAL_PRIORITY_CLASS, env.envp, cwd, &si, &pi); + newprocok = CreateProcess(NULL, command, &security, &security, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi); } else { spprintf(&command_with_cmd, 0, "%s /c %s", GetVersion() < 0x80000000 ? COMSPEC_NT : COMSPEC_9X, command); - newprocok = CreateProcess(NULL, command_with_cmd, &security, &security, TRUE, NORMAL_PRIORITY_CLASS, env.envp, cwd, &si, &pi); + newprocok = CreateProcess(NULL, command_with_cmd, &security, &security, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi); efree(command_with_cmd); }