mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Since requests are mostly originated from the machine itself, so all necessary metadata is local to it. Currently, the desktop platforms are Windows desktop and darwin.
19 lines
520 B
Go
19 lines
520 B
Go
package ctrld
|
|
|
|
import (
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// isWindowsWorkStation reports whether ctrld was run on a Windows workstation machine.
|
|
func isWindowsWorkStation() bool {
|
|
// From https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa
|
|
const VER_NT_WORKSTATION = 0x0000001
|
|
osvi := windows.RtlGetVersion()
|
|
return osvi.ProductType == VER_NT_WORKSTATION
|
|
}
|
|
|
|
// SelfDiscover reports whether ctrld should only do self discover.
|
|
func SelfDiscover() bool {
|
|
return isWindowsWorkStation()
|
|
}
|