aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/tokens.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-15 13:00:56 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-15 13:00:56 +0200
commita464a86c6d8368df784a365c88fbc279a737c87c (patch)
treed562d95c51138fe190baf35abf8c260c9a63ae3a /service/tokens.go
parentbuild: handle errors in env block creation (diff)
downloadwireguard-windows-a464a86c6d8368df784a365c88fbc279a737c87c.tar.xz
wireguard-windows-a464a86c6d8368df784a365c88fbc279a737c87c.zip
service: move WTS upstream
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--service/tokens.go (renamed from service/securityapi.go)42
1 files changed, 0 insertions, 42 deletions
diff --git a/service/securityapi.go b/service/tokens.go
index a7e6072c..dba4cd62 100644
--- a/service/securityapi.go
+++ b/service/tokens.go
@@ -13,48 +13,6 @@ import (
"golang.org/x/sys/windows"
)
-const (
- WTS_CONSOLE_CONNECT = 0x1
- WTS_CONSOLE_DISCONNECT = 0x2
- WTS_REMOTE_CONNECT = 0x3
- WTS_REMOTE_DISCONNECT = 0x4
- WTS_SESSION_LOGON = 0x5
- WTS_SESSION_LOGOFF = 0x6
- WTS_SESSION_LOCK = 0x7
- WTS_SESSION_UNLOCK = 0x8
- WTS_SESSION_REMOTE_CONTROL = 0x9
- WTS_SESSION_CREATE = 0xa
- WTS_SESSION_TERMINATE = 0xb
-)
-
-const (
- WTSActive = 0
- WTSConnected = 1
- WTSConnectQuery = 2
- WTSShadow = 3
- WTSDisconnected = 4
- WTSIdle = 5
- WTSListen = 6
- WTSReset = 7
- WTSDown = 8
- WTSInit = 9
-)
-
-type WTS_SESSION_NOTIFICATION struct {
- Size uint32
- SessionID uint32
-}
-
-type WTS_SESSION_INFO struct {
- SessionID uint32
- WindowStationName *uint16
- State uint32
-}
-
-//sys wtsQueryUserToken(session uint32, token *windows.Token) (err error) = wtsapi32.WTSQueryUserToken
-//sys wtsEnumerateSessions(handle windows.Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) = wtsapi32.WTSEnumerateSessionsW
-//sys wtsFreeMemory(ptr uintptr) = wtsapi32.WTSFreeMemory
-
func tokenIsElevated(token windows.Token) bool {
var isElevated uint32
var outLen uint32