Files
cursor-byok/internal/backend/forwarder/process_exists_windows.go
2026-06-30 10:38:52 +08:00

19 lines
346 B
Go

//go:build windows
package forwarder
import (
"errors"
"golang.org/x/sys/windows"
)
func processExists(pid int) bool {
handle, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid))
if err == nil {
_ = windows.CloseHandle(handle)
return true
}
return errors.Is(err, windows.ERROR_ACCESS_DENIED)
}