summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/wintun_windows.go
AgeCommit message (Collapse)Author
2021-01-07wintun: do not load dll in init()Jason A. Donenfeld
This prevents linking to wintun.dll until it's actually needed, which should improve startup time. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-07wintun: ring management moved to wintun.dllSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-07wintun: load wintun.dll from RCDATA resourceSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-07wintun: migrate to wintun.dll APISimon Rozman
Rather than having every application using Wintun driver reinvent the wheel, the Wintun device/adapter/interface management has been moved from wireguard-go to wintun.dll deployed with Wintun itself. Signed-off-by: Simon Rozman <simon@rozman.si>
2020-05-02global: update header comments and modulesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-05-02wintun: make remaining HWID comparisons case insensitiveSimon Rozman
c85e4a410f27986a2967a49c0155633c716bf3ca introduced preliminary HWID checking to speed up Wintun adapter enumeration. However, all HWID are case insensitive by Windows convention. Furthermore, a device might have multiple HWIDs. When DevInfo's DeviceRegistryProperty(SPDRP_HARDWAREID) method returns []string, all strings returned should be checked against given hardware ID. This issue was discovered when researching Wintun and wireguard-go on Windows 10 ARM64. The Wintun adapter was created using devcon.exe utility with "wintun" hardware ID, causing wireguard-go fail to enumerate the adapter properly. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-10-17wintun: normalize variable names for their typesJason A. Donenfeld
2019-10-17wintun: quickly ignore non-Wintun devicesAvery Pennarun
Some devices take ~2 seconds to enumerate on Windows if we try to get their instance name. The hardware id property, on the other hand, is available right away. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> [zx2c4: inlined this to where it makes sense, reused setupapi const]
2019-10-08wintun: expose versionJason A. Donenfeld
2019-09-01wintun: take mutex first alwaysJason A. Donenfeld
This prevents an ABA deadlock with setupapi's internal locks.
2019-08-30wintun: put mutex into private namespaceJason A. Donenfeld
2019-08-30wintun: take mutex so that deletion uses the right nameJason A. Donenfeld
2019-08-29wintun: move ring constants into moduleJason A. Donenfeld
2019-08-29wintun: delete all interfaces is not used anymoreJason A. Donenfeld
2019-08-29wintun: Wintun->InterfaceJason A. Donenfeld
2019-08-29wintun: keep reference to pool in wintun objectJason A. Donenfeld
2019-08-29wintun: introduce adapter poolsSimon Rozman
This makes wintun package reusable for non-WireGuard applications. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-28wintun: simplify rename logicJason A. Donenfeld
2019-08-28wintun: give better errors when ndis interface listing failsJason A. Donenfeld
2019-08-28wintun: also check for numbered suffix and friendly nameJason A. Donenfeld
2019-08-28wintun: upgrade deleting all interfaces and make it reusableSimon Rozman
DeleteAllInterfaces() didn't check if SPDRP_DEVICEDESC == "WireGuard Tunnel". It deleted _all_ Wintun adapters, not just WireGuard's. Furthermore, the DeleteAllInterfaces() was upgraded into a new function called DeleteMatchingInterfaces() for selectively deletion. This will be used by WireGuard to clean stale Wintun adapters. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-27wintun: cleanup earlierJason A. Donenfeld
2019-08-27wintun: rename duplicate adapters instead of ourselvesJason A. Donenfeld
2019-08-26wintun: match suffix numbersJason A. Donenfeld
2019-08-24wintun: make description consistent across fieldsJason A. Donenfeld
2019-08-22wintun: try multiple names until one isn't a duplicateJason A. Donenfeld
2019-08-21wintun: use nci.dll directly instead of buggy netshellJason A. Donenfeld
2019-08-20wintun: set friendly a bit betterJason A. Donenfeld
This is still wrong, but NETSETUPPKEY_Driver_FriendlyName seems a bit tricky to use.
2019-08-19wintun: also set friendly name after setting interface nameJason A. Donenfeld
2019-08-19wintun: defer requires unique variableJason A. Donenfeld
2019-08-19wintun: set adapter description nameJason A. Donenfeld
2019-08-02wintun: merge opening device registry keySimon Rozman
This also introduces waiting for key to appear on initial access. See if this resolves the issue caused by HDD power-up delay resulting in failure to create the adapter. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-02wintun: simplify checking reboot requirementSimon Rozman
We never checked checkReboot() reported error anyway. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-02wintun: refactor `err == nil` error checkingSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-08-02wintun: handle error for deadgwdetectJason A. Donenfeld
2019-07-23wintun: get interface path properly with cfgmgrJason A. Donenfeld
2019-07-23wintun: simplify resolution of dev nodeJason A. Donenfeld
2019-07-22wintun: enable sharing of pnp nodeJason A. Donenfeld
2019-07-19tun: windows: get rid of retry logicJason A. Donenfeld
Things work fine on Windows 8.
2019-07-18tun: windows: switch to NDIS device objectJason A. Donenfeld
2019-07-18wintun: calculate path of NDIS device object symbolic linkJason A. Donenfeld
2019-06-18tun: windows: never retry open on Windows 10Jason A. Donenfeld
2019-06-11wintun: increase registry timeoutJason A. Donenfeld
2019-06-10wintun: add helper for cleaning upJason A. Donenfeld
2019-06-10wintun: simplify error matching and remove dumb commentsJason A. Donenfeld
2019-06-10wintun: fix comments and remove hwnd paramJason A. Donenfeld
This now looks more idiomatic.
2019-06-10wintun: allow controlling GUIDJason A. Donenfeld
2019-06-06global: fixup TODO comment spacingJason A. Donenfeld
2019-06-06wintun: guid functions are upstreamJason A. Donenfeld
2019-06-06wintun: simplify DeleteInterface method signatureSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>