summaryrefslogtreecommitdiff
path: root/tun/wintun/wintun_windows.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* wintun: registry: revise value readingSimon Rozman2019-05-111-1/+1
| | | | | | | | | | | | | | - 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-101-3/+3
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: IpConfig is a MULTI_SZ, and fix errorsJason A. Donenfeld2019-05-101-44/+49
|
* 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-101-67/+104
| | | | | | By using RegNotifyChangeKeyValue(). Also disable dead gateway detection. Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: safer aliasing of slice typesJason A. Donenfeld2019-05-031-5/+1
|
* wintun: don't retry when not creatingJason A. Donenfeld2019-05-021-6/+23
| | | | | | 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.
* windows: use proper constants from updated x/sysJason A. Donenfeld2019-04-131-4/+4
|
* wintun: rename device using undocumented API that netsh.exe usesJason A. Donenfeld2019-04-011-1/+9
|
* wintun: add more retry loopsJason A. Donenfeld2019-04-011-18/+9
|
* 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-221-17/+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-081-3/+3
| | | | 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-071-59/+72
| | | | | | | | | | | | | | | | | | | | 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>
* wintun: Resolve some of golint warningsSimon Rozman2019-03-041-11/+20
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* Simplify reading NetCfgInstanceId from registrySimon Rozman2019-03-041-8/+2
| | | | | | | | As querying non-existing registry value and reading non-existing registry string value both return ERROR_FILE_NOT_FOUND, we can use later only. Signed-off-by: Simon Rozman <simon@rozman.si>
* Unify interface-specific network registry key openSimon Rozman2019-03-041-10/+19
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* Change package pathJason A. Donenfeld2019-02-181-2/+2
|
* setupapi: Rename SP_REMOVEDEVICE_PARAMS to RemoveDeviceParamsSimon Rozman2019-02-071-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: Rename SP_CLASSINSTALL_HEADER to ClassInstallHeaderSimon Rozman2019-02-071-10/+4
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: Rename SP_DEVINFO_DATA to DevInfoDataSimon Rozman2019-02-071-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Detect if a foreign interface with the same name existsSimon Rozman2019-02-071-3/+36
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Clean excessive setupapi.DevInfo.GetDeviceInfoListDetail() callSimon Rozman2019-02-071-14/+0
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Explain rationale behind case-insensitive interface namesSimon Rozman2019-02-071-1/+5
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: add FlushInterface stubJason A. Donenfeld2019-02-071-4/+13
|
* wintun: Compare values of GUID, not pointers, when removingJason A. Donenfeld2019-02-071-1/+1
|
* wintun: Introduce new package for obscuring Windows bitsJason A. Donenfeld2019-02-071-0/+461