aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/updater/versions_arm.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-11 21:41:10 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-16 18:17:05 +0100
commit7d7885af1816e9c68338d4351e8fe6bf5542e7a7 (patch)
treea0d4d0a03d54343483b8ff00a78f25d7c0916a87 /updater/versions_arm.go
parentbuild: opt-in to resource loading of wintun.dll (diff)
downloadwireguard-windows-7d7885af1816e9c68338d4351e8fe6bf5542e7a7.tar.xz
wireguard-windows-7d7885af1816e9c68338d4351e8fe6bf5542e7a7.zip
updater: use constants from debug/pe
These are nice here, but we don't want to use them for memmod, since there we need a more complete linker. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'updater/versions_arm.go')
-rw-r--r--updater/versions_arm.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/updater/versions_arm.go b/updater/versions_arm.go
index 2ffb4b74..f3e43ec3 100644
--- a/updater/versions_arm.go
+++ b/updater/versions_arm.go
@@ -6,6 +6,7 @@
package updater
import (
+ "debug/pe"
"errors"
"golang.org/x/sys/windows"
@@ -17,15 +18,15 @@ func findArch() (arch string, err error) {
if err2 != nil {
var isWow64 bool
if windows.IsWow64Process(process, &isWow64) != nil || !isWow64 {
- nativeMachine = IMAGE_FILE_MACHINE_ARMNT
+ nativeMachine = pe.IMAGE_FILE_MACHINE_ARMNT
} else {
- nativeMachine = IMAGE_FILE_MACHINE_ARM64
+ nativeMachine = pe.IMAGE_FILE_MACHINE_ARM64
}
}
switch nativeMachine {
- case IMAGE_FILE_MACHINE_ARM64:
+ case pe.IMAGE_FILE_MACHINE_ARM64:
arch = "arm64"
- case IMAGE_FILE_MACHINE_ARMNT:
+ case pe.IMAGE_FILE_MACHINE_ARMNT:
arch = "arm"
default:
err = errors.New("Invalid GOARCH")