File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 9
9
"fmt"
10
10
"log"
11
11
"os"
12
+ "runtime"
12
13
"strconv"
13
14
"strings"
14
15
"time"
@@ -60,6 +61,20 @@ func usage() {
60
61
os .Exit (1 )
61
62
}
62
63
64
+ func checkForWow64 () {
65
+ if runtime .GOARCH == "arm" { //TODO: remove this exception when Go supports arm64
66
+ return
67
+ }
68
+ var b bool
69
+ err := windows .IsWow64Process (windows .CurrentProcess (), & b )
70
+ if err != nil {
71
+ fatalf ("Unable to determine whether the process is running under WOW64: %v" , err )
72
+ }
73
+ if b {
74
+ fatalf ("You must use the 64-bit version of WireGuard on this computer." )
75
+ }
76
+ }
77
+
63
78
func checkForAdminGroup () {
64
79
// This is not a security check, but rather a user-confusion one.
65
80
var processToken windows.Token
@@ -102,6 +117,8 @@ func pipeFromHandleArgument(handleStr string) (*os.File, error) {
102
117
}
103
118
104
119
func main () {
120
+ checkForWow64 ()
121
+
105
122
if len (os .Args ) <= 1 {
106
123
checkForAdminGroup ()
107
124
if ui .RaiseUI () {
You can’t perform that action at this time.
0 commit comments