@@ -235,13 +235,13 @@ type ProcAttr struct {
235
235
}
236
236
237
237
type SysProcAttr struct {
238
- HideWindow bool
239
- CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess
240
- CreationFlags uint32
241
- Token Token // if set, runs new process in the security context represented by the token
242
- ProcessAttributes * SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
243
- ThreadAttributes * SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
244
- DontInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
238
+ HideWindow bool
239
+ CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess
240
+ CreationFlags uint32
241
+ Token Token // if set, runs new process in the security context represented by the token
242
+ ProcessAttributes * SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
243
+ ThreadAttributes * SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
244
+ NoInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
245
245
}
246
246
247
247
var zeroProcAttr ProcAttr
@@ -342,9 +342,9 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle
342
342
343
343
flags := sys .CreationFlags | CREATE_UNICODE_ENVIRONMENT
344
344
if sys .Token != 0 {
345
- err = CreateProcessAsUser (sys .Token , argv0p , argvp , sys .ProcessAttributes , sys .ThreadAttributes , ! sys .DontInheritHandles , flags , createEnvBlock (attr .Env ), dirp , si , pi )
345
+ err = CreateProcessAsUser (sys .Token , argv0p , argvp , sys .ProcessAttributes , sys .ThreadAttributes , ! sys .NoInheritHandles , flags , createEnvBlock (attr .Env ), dirp , si , pi )
346
346
} else {
347
- err = CreateProcess (argv0p , argvp , sys .ProcessAttributes , sys .ThreadAttributes , ! sys .DontInheritHandles , flags , createEnvBlock (attr .Env ), dirp , si , pi )
347
+ err = CreateProcess (argv0p , argvp , sys .ProcessAttributes , sys .ThreadAttributes , ! sys .NoInheritHandles , flags , createEnvBlock (attr .Env ), dirp , si , pi )
348
348
}
349
349
if err != nil {
350
350
return 0 , 0 , err
0 commit comments