github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/pkg/pidfile/pidfile_windows.go (about) 1 package pidfile // import "github.com/docker/docker/pkg/pidfile" 2 3 import ( 4 "golang.org/x/sys/windows" 5 ) 6 7 const ( 8 processQueryLimitedInformation = 0x1000 9 10 stillActive = 259 11 ) 12 13 func processExists(pid int) bool { 14 h, err := windows.OpenProcess(processQueryLimitedInformation, false, uint32(pid)) 15 if err != nil { 16 return false 17 } 18 var c uint32 19 err = windows.GetExitCodeProcess(h, &c) 20 windows.Close(h) 21 if err != nil { 22 return c == stillActive 23 } 24 return true 25 }