aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/zsyscall_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 17:00:10 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 17:10:50 +0200
commit2149611190c6d80feb8f752da190378127207a6a (patch)
treea3050b6130f1eef70baccfe7305a7a7884c4e153 /service/zsyscall_windows.go
parentservice: drop all privileges for tunnel service (diff)
downloadwireguard-windows-2149611190c6d80feb8f752da190378127207a6a.tar.xz
wireguard-windows-2149611190c6d80feb8f752da190378127207a6a.zip
service: clean up token mangling
Diffstat (limited to '')
-rw-r--r--service/zsyscall_windows.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/service/zsyscall_windows.go b/service/zsyscall_windows.go
index a269d3a8..cc40ddea 100644
--- a/service/zsyscall_windows.go
+++ b/service/zsyscall_windows.go
@@ -44,8 +44,6 @@ var (
procWTSQueryUserToken = modwtsapi32.NewProc("WTSQueryUserToken")
procWTSEnumerateSessionsW = modwtsapi32.NewProc("WTSEnumerateSessionsW")
procWTSFreeMemory = modwtsapi32.NewProc("WTSFreeMemory")
- procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges")
- procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
procNotifyServiceStatusChangeW = modadvapi32.NewProc("NotifyServiceStatusChangeW")
procSleepEx = modkernel32.NewProc("SleepEx")
)
@@ -79,36 +77,6 @@ func wtsFreeMemory(ptr uintptr) {
return
}
-func adjustTokenPrivileges(token windows.Token, disableAllPrivileges bool, newstate *TOKEN_PRIVILEGES, buflen uint32, prevstate *TOKEN_PRIVILEGES, returnlen *uint32) (err error) {
- var _p0 uint32
- if disableAllPrivileges {
- _p0 = 1
- } else {
- _p0 = 0
- }
- r1, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen)))
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func openProcessToken(processHandle windows.Handle, accessFlags uint32, token *windows.Token) (err error) {
- r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(processHandle), uintptr(accessFlags), uintptr(unsafe.Pointer(token)))
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
func notifyServiceStatusChange(service windows.Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) {
r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier)))
if r0 != 0 {