From 389729afbddfecb47fcff77e2445f96f21a96ba7 Mon Sep 17 00:00:00 2001 From: Chen Xijun Date: Wed, 27 Jul 2022 14:54:20 +0800 Subject: [PATCH] Fix tap-windows for arm64 --- osdep/WindowsEthernetTap.cpp | 5 +++++ windows/TapDriver6/tap.h | 5 +++-- windows/TapDriver6/zttap300.inf | 7 ++++++- windows/ZeroTierOne/ZeroTierOne.vcxproj | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp index c0dcbd98f..e63a38570 100644 --- a/osdep/WindowsEthernetTap.cpp +++ b/osdep/WindowsEthernetTap.cpp @@ -78,7 +78,12 @@ public: { #ifdef _WIN64 is64Bit = TRUE; +#ifdef _M_ARM64 + tapDriverPath = "\\tap-windows\\arm64\\zttap300.inf"; +#else tapDriverPath = "\\tap-windows\\x64\\zttap300.inf"; +#endif + #else is64Bit = FALSE; IsWow64Process(GetCurrentProcess(),&is64Bit); diff --git a/windows/TapDriver6/tap.h b/windows/TapDriver6/tap.h index 76df77980..d3edacd51 100644 --- a/windows/TapDriver6/tap.h +++ b/windows/TapDriver6/tap.h @@ -25,10 +25,11 @@ #define __TAP_H #ifndef NDIS_SUPPORT_NDIS6 +#define NDIS_MINIPORT_DRIVER 1 #define NDIS_SUPPORT_NDIS6 1 -#define NDIS_SUPPORT_NDIS61 1 +#define NDIS_SUPPORT_NDIS630 1 #define NDIS_WDM1 1 -#define NDIS61_MINIPORT 1 +#define NDIS630_MINIPORT 1 #endif #include diff --git a/windows/TapDriver6/zttap300.inf b/windows/TapDriver6/zttap300.inf index 8b12a1b3c..3b191340e 100644 --- a/windows/TapDriver6/zttap300.inf +++ b/windows/TapDriver6/zttap300.inf @@ -34,8 +34,9 @@ DeviceDescription = "ZeroTier Virtual Port" Provider = "ZeroTier" [Manufacturer] -%Provider%=zttap300,NTx86 +;%Provider%=zttap300,NTx86 ;%Provider%=zttap300,NTamd64 +%Provider%=zttap300,NTarm64 [zttap300.NTx86] %DeviceDescription% = zttap300.ndi, root\zttap300 ; Root enumerated @@ -45,6 +46,10 @@ Provider = "ZeroTier" %DeviceDescription% = zttap300.ndi, root\zttap300 ; Root enumerated %DeviceDescription% = zttap300.ndi, zttap300 ; Legacy +[zttap300.NTarm64] +%DeviceDescription% = zttap300.ndi, root\zttap300 ; Root enumerated +%DeviceDescription% = zttap300.ndi, zttap300 ; Legacy + ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index bb1c0888a..a98385487 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -647,7 +647,7 @@ true wbemuuid.lib;wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;zeroidc.lib;bcrypt.lib;userenv.lib;crypt32.lib;secur32.lib;ncrypt.lib;ntdll.lib;%(AdditionalDependencies) false - $(SolutionDir)..\zeroidc\target\x86_64-pc-windows-msvc\release\;%(AdditionalLibraryDirectories) + $(SolutionDir)..\zeroidc\target\aarch64-pc-windows-msvc\release\;%(AdditionalLibraryDirectories)