aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun (follow)
Commit message (Collapse)AuthorAgeFilesLines
* namedpipe: rename from winpipe to keep in sync with CL299009Jason A. Donenfeld2021-11-043-368/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: align 64-bit argument on ARM32Jason A. Donenfeld2021-10-261-1/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: allow retrieving DLL versionJason A. Donenfeld2021-10-202-1/+31
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: remove memmod option for dll loadingJason A. Donenfeld2021-10-1613-1481/+39
| | | | | | Only wireguard-windows used this, and it's moving to wgnt exclusively. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: remove old-style build tagsJason A. Donenfeld2021-10-126-6/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: add newer-style build tagsJason A. Donenfeld2021-10-122-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: use new swdevice-based API for upcoming Wintun 0.14Jason A. Donenfeld2021-10-121-123/+54
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conn,wintun: use unsafe.Slice instead of unsafeSliceJason A. Donenfeld2021-10-111-20/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: import from wireguard-windowsJason A. Donenfeld2021-10-115-33/+95
| | | | | | | We'll eventually be getting rid of it here, but keep it sync'd up for now. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: register exception handler tablesJason A. Donenfeld2021-08-052-0/+19
| | | | | | | | Otherwise recent WDK binaries fail on ARM64, where an exception handler is used for trapping an illegal instruction when ARMv8.1 atomics are being tested for functionality. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: fix protected delayed load the right wayJason A. Donenfeld2021-07-292-9/+13
| | | | | | | | | | | The reason this was failing before is that dloadsup.h's DloadObtainSection was doing a linear search of sections to find which header corresponds with the IMAGE_DELAYLOAD_DESCRIPTOR section, and we were stupidly overwriting the VirtualSize field, so the linear search wound up matching the .text section, which then it found to not be marked writable and failed with FAST_FAIL_DLOAD_PROTECTION_FAILURE. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: disable protected delayed load for nowJason A. Donenfeld2021-07-294-2/+155
| | | | | | | Probably a bad idea, but we don't currently support it, and those huge windows.NewCallback trampolines make juicer targets anyway. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: use resource functions from x/sysJason A. Donenfeld2021-03-084-266/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* memmod: do not use IsBadReadPtrJason A. Donenfeld2021-03-084-61/+1
| | | | | | It should be enough to check for the trailing zero name. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyrightJason A. Donenfeld2021-01-2816-16/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tun/wintun/memmod: gofmtJosh Bleecher Snyder2021-01-201-1/+1
| | | | Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
* tun/wintun/memmod: fix format verbJosh Bleecher Snyder2021-01-201-1/+1
| | | | | | Caught by 'go vet'. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
* memmod: apply explicit build tags to _32 and _64 filesJason A. Donenfeld2021-01-074-4/+4
| | | | | | | | | | Since _32 and _64 aren't valid goarchs, they don't match _GOOS_GOARCH, and so the existing tags wind up not being restricted to windows-only. This fixes the problem by adding windows to the tags explicitly. We could also fix it by calling the files _32_windows or _64_windows, but that changes the convention with the other single-arch files. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: do not load dll in init()Jason A. Donenfeld2021-01-075-14/+21
| | | | | | | 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>
* memmod: fix import loading function usageJason A. Donenfeld2020-11-273-26/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: load from filesystem by defaultJason A. Donenfeld2020-11-113-39/+109
| | | | | | | | We let people loading this from resources opt in via: go build -tags load_wintun_from_rsrc Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: switch to using %w instead of %v for ErrorfJason A. Donenfeld2020-11-074-24/+24
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: ring management moved to wintun.dllSimon Rozman2020-11-073-128/+108
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: load wintun.dll from RCDATA resourceSimon Rozman2020-11-0717-1/+1575
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: migrate to wintun.dll APISimon Rozman2020-11-0724-3701/+151
| | | | | | | | 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>
* tun/wintun/registry: fix Go 1.15 race/checkptr failureBrad Fitzpatrick2020-10-211-1/+1
| | | | | | Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> [Jason: ran go mod tidy.] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update header comments and modulesJason A. Donenfeld2020-05-0219-19/+19
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wintun: make remaining HWID comparisons case insensitiveSimon Rozman2020-05-021-2/+19
| | | | | | | | | | | | | | | | | 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>
* setupapi: extend struct size constant definitions for arm(64)Simon Rozman2020-05-022-0/+4
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: split error message for create vs open namespace.Avery Pennarun2020-05-021-1/+4
| | | | Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
* wintun: manage ring memory manuallyJason A. Donenfeld2019-11-221-4/+24
| | | | | It's large and Go's garbage collector doesn't deal with it especially well.
* global: fix a few typos courtesy of codespellJonathan Tooker2019-10-221-1/+1
| | | | Signed-off-by: Jonathan Tooker <jonathan.tooker@netprotect.com>
* namespaceapi: remove tasteless commentJason A. Donenfeld2019-10-211-1/+1
|
* wintun: normalize variable names for their typesJason A. Donenfeld2019-10-171-72/+72
|
* wintun: quickly ignore non-Wintun devicesAvery Pennarun2019-10-171-0/+18
| | | | | | | | | 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]
* wintun: expose versionJason A. Donenfeld2019-10-081-1/+29
|
* mod: bump versionsJason A. Donenfeld2019-10-046-6/+6
|
* winpipe: use x/sys/windows instead of syscallJason A. Donenfeld2019-09-161-3/+2
|
* wintun: use correct length for security attributesJason A. Donenfeld2019-09-161-1/+1
|
* namespaceapi: AddSIDToBoundaryDescriptor modifies the handleJason A. Donenfeld2019-09-051-2/+2
|
* wintun: take mutex first alwaysJason A. Donenfeld2019-09-011-9/+9
| | | | This prevents an ABA deadlock with setupapi's internal locks.
* wintun: consider abandoned mutexes as releasedJason A. Donenfeld2019-09-011-1/+1
|
* wintun: put mutex into private namespaceJason A. Donenfeld2019-08-303-26/+99
|
* namespaceapi: fix mistakeJason A. Donenfeld2019-08-302-4/+4
|
* namespaceapi: initial versionSimon Rozman2019-08-303-0/+207
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: take mutex so that deletion uses the right nameJason A. Donenfeld2019-08-301-9/+70
|
* wintun: move ring constants into moduleJason A. Donenfeld2019-08-292-2/+99
|
* wintun: delete all interfaces is not used anymoreJason A. Donenfeld2019-08-291-9/+0
|
* wintun: Wintun->InterfaceJason A. Donenfeld2019-08-291-27/+26
|
* wintun: keep reference to pool in wintun objectJason A. Donenfeld2019-08-291-7/+9
|