Skip to content

Commit

Permalink
driver: align 64-bit argument on ARM32
Browse files Browse the repository at this point in the history
Signed-off-by: Jason A. Donenfeld <[email protected]>
  • Loading branch information
zx2c4 committed Oct 26, 2021
1 parent dc5878b commit dca9737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion driver/driver_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,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, _ uint32, 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)
}
Expand Down

0 comments on commit dca9737

Please sign in to comment.