vendor: add qingstor-sdk-go for QingStor
This commit is contained in:
parent
f682002b84
commit
466dd22b44
136 changed files with 15952 additions and 1 deletions
23
vendor/github.com/pengsrc/go-shared/pid/pidfile_windows.go
generated
vendored
Normal file
23
vendor/github.com/pengsrc/go-shared/pid/pidfile_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
package pid
|
||||
|
||||
import "syscall"
|
||||
|
||||
const (
|
||||
processQueryLimitedInformation = 0x1000
|
||||
|
||||
stillActive = 259
|
||||
)
|
||||
|
||||
func processExists(pid int) bool {
|
||||
h, err := syscall.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
var c uint32
|
||||
err = syscall.GetExitCodeProcess(h, &c)
|
||||
syscall.Close(h)
|
||||
if err != nil {
|
||||
return c == stillActive
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue