mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
17 lines
391 B
Go
17 lines
391 B
Go
//go:build windows
|
|
package windows
|
|
|
|
import "syscall"
|
|
|
|
// IsProcessRunning checks if a process with the given PID exists on Windows.
|
|
func IsProcessRunning(pid int) bool {
|
|
const PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
|
|
|
|
handle, err := syscall.OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid))
|
|
if err != nil {
|
|
return false
|
|
}
|
|
syscall.CloseHandle(handle)
|
|
return true
|
|
}
|