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 99 "fmt"
1010 "log"
1111 "os"
12+ "runtime"
1213 "strconv"
1314 "strings"
1415 "time"
@@ -60,6 +61,20 @@ func usage() {
6061 os .Exit (1 )
6162}
6263
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+
6378func checkForAdminGroup () {
6479 // This is not a security check, but rather a user-confusion one.
6580 var processToken windows.Token
@@ -102,6 +117,8 @@ func pipeFromHandleArgument(handleStr string) (*os.File, error) {
102117}
103118
104119func main () {
120+ checkForWow64 ()
121+
105122 if len (os .Args ) <= 1 {
106123 checkForAdminGroup ()
107124 if ui .RaiseUI () {
You can’t perform that action at this time.
0 commit comments