aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/version/zsyscall_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-03 22:44:21 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-03 22:44:21 +0200
commit43d81aed6092b5ea2d82507c3099411690fa8687 (patch)
treee5141ec155967c53830b7a5e87986135df968b48 /version/zsyscall_windows.go
parentfirewall: DNS is TCP and UDP (diff)
downloadwireguard-windows-43d81aed6092b5ea2d82507c3099411690fa8687.tar.xz
wireguard-windows-43d81aed6092b5ea2d82507c3099411690fa8687.zip
version: expose OsVersion for firewall
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'version/zsyscall_windows.go')
-rw-r--r--version/zsyscall_windows.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/version/zsyscall_windows.go b/version/zsyscall_windows.go
index ef4e11d7..711d76da 100644
--- a/version/zsyscall_windows.go
+++ b/version/zsyscall_windows.go
@@ -46,9 +46,15 @@ var (
procVerQueryValueW = modversion.NewProc("VerQueryValueW")
)
-func rtlGetVersion(versionInfo *osVersionInfo) (nterr uint32) {
- r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(versionInfo)), 0, 0)
- nterr = uint32(r0)
+func rtlGetVersion(versionInfo *OsVersionInfo) (err error) {
+ r1, _, e1 := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(versionInfo)), 0, 0)
+ if r1 != 0 {
+ if e1 != 0 {
+ err = errnoErr(e1)
+ } else {
+ err = syscall.EINVAL
+ }
+ }
return
}