]> 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:44:30 +0000 (20:44 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 2 Apr 2007 20:44:30 +0000 (20:44 +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 26f4a6fc8a89beea975c57d8fe3c98a26aa4040c..2fc8e6eae8eac5f8eabd49f125652daa6965690a 100644 (file)
@@ -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);
        }