aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* setupapi: add SetDeviceRegistryPropertyString descriptionSimon Rozman2019-06-101-1/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: unify ERROR_INSUFFICIENT_BUFFER handlingSimon Rozman2019-06-101-58/+32
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: allow controlling GUIDJason A. Donenfeld2019-06-101-1/+20
|
* setupapi: add DeviceInstanceID()Jason A. Donenfeld2019-06-103-0/+41
|
* global: fixup TODO comment spacingJason A. Donenfeld2019-06-061-4/+4
|
* wintun: guid functions are upstreamJason A. Donenfeld2019-06-065-117/+11
|
* wintun: simplify DeleteInterface method signatureSimon Rozman2019-06-061-56/+77
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: don't run HrRenameConnection in separate threadJason A. Donenfeld2019-06-051-3/+2
| | | | | It's very slow, but unfortunately we haven't a choice. NLA needs this to have completed.
* setupapi, wintun: replace syscall with golang.org/x/sys/windowsSimon Rozman2019-06-044-36/+32
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: set DI_QUIETINSTALL flag for GUI-less device managementSimon Rozman2019-06-041-3/+26
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: define PropChangeParams structSimon Rozman2019-06-041-1/+20
| | | | | | | This structure is required for calling DIF_PROPERTYCHANGE installer class. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: revise GetInterface()Simon Rozman2019-05-241-3/+4
| | | | | | | | | | | - Make foreign interface found error numeric to ease condition detection. - Update GetInterface() documentation. - Make tun.CreateTUN() quit when foreign interface found before attempting to create a Wintun interface with a duplicate name. Creation is futile. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: never return nil, nilJason A. Donenfeld2019-05-231-1/+1
|
* setupapi: trim "Get" from gettersSimon Rozman2019-05-224-52/+52
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: don't try to flush interface, but rather deleteJason A. Donenfeld2019-05-171-9/+0
|
* wintun: make certain methods privateJason A. Donenfeld2019-05-171-23/+38
|
* global: regroup all importsJason A. Donenfeld2019-05-141-1/+1
|
* wintun: registry: fix nitsJason A. Donenfeld2019-05-111-17/+20
|
* wintun: registry: revise value readingSimon Rozman2019-05-112-67/+82
| | | | | | | | | | | | | | - Make getStringValueRetry() reusable for reading any value type. This merges code from GetIntegerValueWait(). - expandString() >> toString() and extend to support REG_MULTI_SZ (to return first value of REG_MULTI_SZ). Furthermore, doing our own UTF-16 to UTF-8 conversion works around a bug in windows/registry's GetStringValue() non-zero terminated string handling. - Provide toInteger() analogous to toString() - GetStringValueWait() tolerates and reads REG_MULTI_SZ too now. It returns REG_MULTI_SZ[0], making GetFirstStringValueWait() redundant. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: call HrRenameConnection in another threadJason A. Donenfeld2019-05-101-2/+3
|
* wintun: enumerate faster by using COMPATDRIVER instead of CLASSDRIVERJason A. Donenfeld2019-05-101-1/+1
|
* wintun: destroy devinfolist after usageJason A. Donenfeld2019-05-101-0/+1
|
* wintun: registry: replace REG_NOTIFY with NOTIFYSimon Rozman2019-05-103-13/+9
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: IpConfig is a MULTI_SZ, and fix errorsJason A. Donenfeld2019-05-102-49/+72
|
* wintun: poll for device keyJason A. Donenfeld2019-05-101-9/+10
| | | | It's actually pretty hard to guess where it is.
* wintun: fix scope of error objectJason A. Donenfeld2019-05-101-5/+6
|
* wintun: wait for interface registry key on device creationSimon Rozman2019-05-106-109/+518
| | | | | | By using RegNotifyChangeKeyValue(). Also disable dead gateway detection. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: fix GUID leading zero paddingSimon Rozman2019-05-091-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: safer aliasing of slice typesJason A. Donenfeld2019-05-035-23/+40
|
* wintun: work around GetInterface staleness bugJason A. Donenfeld2019-05-031-2/+2
|
* wintun: don't retry when not creatingJason A. Donenfeld2019-05-022-9/+26
| | | | | | The only time we're trying to counteract the race condition is when we're creating a driver. When we're simply looking up all drivers, it doesn't make sense to retry.
* wintun: try harder to open registry keyJason A. Donenfeld2019-04-291-2/+2
| | | | | This sucks. Can we please find a deterministic way of doing this instead?
* setupapi: Fix struct size mismatchesSimon Rozman2019-04-194-8/+27
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: actually fix padding by rounding up to sizeof(void*)Jason A. Donenfeld2019-04-191-1/+1
|
* setupapi: Revise DrvInfoDetailData struct size calculationSimon Rozman2019-04-182-3/+7
| | | | | | | Go adds trailing padding to DrvInfoDetailData struct in GOARCH=386 which confuses SetupAPI expecting exactly sizeof(SP_DRVINFO_DETAIL_DATA). Signed-off-by: Simon Rozman <simon@rozman.si>
* windows: use proper constants from updated x/sysJason A. Donenfeld2019-04-133-16/+16
|
* wintun: rename device using undocumented API that netsh.exe usesJason A. Donenfeld2019-04-012-1/+41
|
* wintun: add more retry loopsJason A. Donenfeld2019-04-012-18/+51
|
* wintun: query for NetCfgInstanceId several timesJason A. Donenfeld2019-03-221-5/+16
|
* tun: windows: Make adapter rename asynchronousSimon Rozman2019-03-221-55/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Adapter devices renamed to WINTUN<LUID Index>Simon Rozman2019-03-223-51/+62
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: wintun does iocpJason A. Donenfeld2019-03-181-7/+0
|
* wintun: Poll more oftenJason A. Donenfeld2019-03-101-1/+1
|
* wintun: Make errors more descriptiveSimon Rozman2019-03-081-15/+20
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Return correct reboot-req flag on CreateInterface() error tooSimon Rozman2019-03-081-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Fix double-quoted strings escaping on outputSimon Rozman2019-03-082-4/+4
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Introduce SetupAPI enumerator and machineName constsSimon Rozman2019-03-081-4/+7
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: CleanupSimon Rozman2019-03-071-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Refactor network registry key name generationSimon Rozman2019-03-071-22/+18
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Revise interface creation waitSimon Rozman2019-03-073-59/+106
| | | | | | | | | | | | | | | | | | | | DIF_INSTALLDEVICE returns almost immediately, while the device installation continues in the background. It might take a while, before all registry keys and values are populated. Previously, wireguard-go waited for HKLM\SYSTEM\CurrentControlSet\ Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\<id> registry key only. Followed by a SetInterfaceName() method of Wintun struct which tried to access HKLM\SYSTEM\CurrentControlSet\Control\Network\ {4D36E972-E325-11CE-BFC1-08002BE10318}\<id>\Connection registry key might not be available yet. This commit loops until both registry keys are available before returning from CreateInterface() function. Signed-off-by: Simon Rozman <simon@rozman.si>