diff --git a/doc/go1.16.html b/doc/go1.16.html index 74d31cc9809..4ba9d6785c8 100644 --- a/doc/go1.16.html +++ b/doc/go1.16.html @@ -334,7 +334,7 @@ Do not send CLs removing the interior tags from such phrases.
syscall

- SysProcAttr on Windows has a new DontInheritHandles field that disables inheriting handles when creating a new process. + SysProcAttr on Windows has a new NoInheritHandles field that disables inheriting handles when creating a new process.

diff --git a/src/syscall/exec_windows.go b/src/syscall/exec_windows.go index 9f827c53f83..46cbd7567dd 100644 --- a/src/syscall/exec_windows.go +++ b/src/syscall/exec_windows.go @@ -235,13 +235,13 @@ type ProcAttr struct { } type SysProcAttr struct { - HideWindow bool - CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess - CreationFlags uint32 - Token Token // if set, runs new process in the security context represented by the token - ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process - ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process - DontInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process + HideWindow bool + CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess + CreationFlags uint32 + Token Token // if set, runs new process in the security context represented by the token + ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process + ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process + NoInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process } var zeroProcAttr ProcAttr @@ -342,9 +342,9 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle flags := sys.CreationFlags | CREATE_UNICODE_ENVIRONMENT if sys.Token != 0 { - err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi) + err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi) } else { - err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi) + err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi) } if err != nil { return 0, 0, err