Commit e1e80a5e authored by Amos Wenger's avatar Amos Wenger

Introduce creation flag CREATE_NEW_CONSOLE - don't specify USESTDHANDLES and...

Introduce creation flag CREATE_NEW_CONSOLE - don't specify USESTDHANDLES and clear hStd{Input,Output,Error} when it's used.
parent 327501e0
Pipeline #12404 passed with stage
in 32 seconds
......@@ -219,6 +219,13 @@ func StartProcessWithLogon(argv0 string, argv []string, username string, domain
si.StdOutput = fd[1]
si.StdErr = fd[2]
if sys.CreationFlags&CREATE_NEW_CONSOLE != 0 {
si.Flags &^= syscall.STARTF_USESTDHANDLES
si.StdInput = 0
si.StdOutput = 0
si.StdErr = 0
}
pi := new(syscall.ProcessInformation)
if username == "" {
......
......@@ -41,6 +41,7 @@ type JobObjectAssociateCompletionPort struct {
const (
CREATE_SUSPENDED = 0x00000004
CREATE_NEW_CONSOLE = 0x00000010
PROCESS_ALL_ACCESS = syscall.STANDARD_RIGHTS_REQUIRED | syscall.SYNCHRONIZE | 0xfff
THREAD_SUSPEND_RESUME = 0x0002
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment