mirror of
https://github.com/rclone/rclone.git
synced 2025-12-19 09:43:14 +00:00
vendor: add qingstor-sdk-go for QingStor
This commit is contained in:
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
|
||||
}
|
||||
Reference in New Issue
Block a user