diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-26 14:51:44 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-26 14:53:40 +0200 |
commit | e42c6c4bc2d0d1e6b4f247b98cf4ead8a1b08a2e (patch) | |
tree | 37656da55040701151ce4bbb32c1e618c1959f76 | |
parent | 828a885a7140e1fe23a684e4a8126cfd978ca0c8 (diff) |
wintun: align 64-bit argument on ARM32
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | tun/wintun/wintun_windows.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go index b3aa6e9..2fe26a7 100644 --- a/tun/wintun/wintun_windows.go +++ b/tun/wintun/wintun_windows.go @@ -53,10 +53,14 @@ func logMessage(level loggerLevel, timestamp uint64, msg *uint16) int { func setupLogger(dll *lazyDLL) { var callback uintptr - if runtime.GOARCH == "386" || runtime.GOARCH == "arm" { + if runtime.GOARCH == "386" { callback = windows.NewCallback(func(level loggerLevel, timestampLow, timestampHigh uint32, msg *uint16) int { return logMessage(level, uint64(timestampHigh)<<32|uint64(timestampLow), msg) }) + } else if runtime.GOARCH == "arm" { + callback = windows.NewCallback(func(level loggerLevel, _, timestampLow, timestampHigh uint32, msg *uint16) int { + return logMessage(level, uint64(timestampHigh)<<32|uint64(timestampLow), msg) + }) } else if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" { callback = windows.NewCallback(logMessage) } |