aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/version/zsyscall_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-29 16:16:48 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-30 08:47:21 -0600
commitb70b012bc692477fdf51b09627c6a7333265ee31 (patch)
tree18badadf8bdf1b77b93932b947a352e5591ddf2b /version/zsyscall_windows.go
parentversion: use ProductName and ProductVersion as strings (diff)
downloadwireguard-windows-b70b012bc692477fdf51b09627c6a7333265ee31.tar.xz
wireguard-windows-b70b012bc692477fdf51b09627c6a7333265ee31.zip
version: hard code name and version at compile time
We really do want the true name and version in logs so that external consumers have a good reference point for helping us debug. We can then do the log file directory explicitly. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--version/zsyscall_windows.go82
1 files changed, 0 insertions, 82 deletions
diff --git a/version/zsyscall_windows.go b/version/zsyscall_windows.go
deleted file mode 100644
index 21684bb3..00000000
--- a/version/zsyscall_windows.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Code generated by 'go generate'; DO NOT EDIT.
-
-package version
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modversion = windows.NewLazySystemDLL("version.dll")
-
- procGetFileVersionInfoSizeW = modversion.NewProc("GetFileVersionInfoSizeW")
- procGetFileVersionInfoW = modversion.NewProc("GetFileVersionInfoW")
- procVerQueryValueW = modversion.NewProc("VerQueryValueW")
-)
-
-func GetFileVersionInfoSize(filename *uint16, zero *uint32) (size uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetFileVersionInfoSizeW.Addr(), 2, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zero)), 0)
- size = uint32(r0)
- if size == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func GetFileVersionInfo(filename *uint16, zero uint32, size uint32, block *byte) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetFileVersionInfoW.Addr(), 4, uintptr(unsafe.Pointer(filename)), uintptr(zero), uintptr(size), uintptr(unsafe.Pointer(block)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func VerQueryValue(block *byte, section *uint16, value **byte, size *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procVerQueryValueW.Addr(), 4, uintptr(unsafe.Pointer(block)), uintptr(unsafe.Pointer(section)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(size)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}