]> granicus.if.org Git - php/commitdiff
fix for #33664 Console window appears when using exec()
authorStanislav Malyshev <stas@php.net>
Mon, 2 Apr 2007 20:48:53 +0000 (20:48 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 2 Apr 2007 20:48:53 +0000 (20:48 +0000)
TSRM/tsrm_win32.c
ext/standard/proc_open.c

index 5a8983b5e45ac3210f519c2a61f7b7811e984886..ae9ea312f2450f0f729e86a81ecf569fb8d32fb5 100644 (file)
@@ -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);
index 9e8e1a3f6217201308c5e29e1f9dc40a7fbb090b..fe1f28c50ad3be17d8796c640f831dc924af7ab5 100644 (file)
@@ -738,11 +738,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);
        }