Detach managed processes from run console
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func TestConfigureManagedProcessCommandPreservesInheritedConsole(t *testing.T) {
|
||||
func TestConfigureManagedProcessCommandDetachesFromRunConsole(t *testing.T) {
|
||||
cmd := exec.Command("cmd.exe")
|
||||
configureManagedProcessCommand(cmd)
|
||||
if cmd.SysProcAttr == nil {
|
||||
@@ -21,9 +21,9 @@ func TestConfigureManagedProcessCommandPreservesInheritedConsole(t *testing.T) {
|
||||
if !cmd.SysProcAttr.HideWindow {
|
||||
t.Fatal("expected managed console window to stay hidden")
|
||||
}
|
||||
expected := uint32(windows.CREATE_NO_WINDOW | windows.CREATE_BREAKAWAY_FROM_JOB)
|
||||
expected := uint32(windows.DETACHED_PROCESS | windows.CREATE_NEW_PROCESS_GROUP | windows.CREATE_BREAKAWAY_FROM_JOB)
|
||||
if cmd.SysProcAttr.CreationFlags != expected {
|
||||
t.Fatalf("expected a hidden breakaway helper without a console, got %#x", cmd.SysProcAttr.CreationFlags)
|
||||
t.Fatalf("expected a detached breakaway helper isolated from Ctrl+C, got %#x", cmd.SysProcAttr.CreationFlags)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user