summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun
AgeCommit message (Collapse)Author
2019-05-11wintun: registry: revise value readingSimon Rozman
- 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>
2019-05-10wintun: call HrRenameConnection in another threadJason A. Donenfeld
2019-05-10wintun: enumerate faster by using COMPATDRIVER instead of CLASSDRIVERJason A. Donenfeld
2019-05-10wintun: destroy devinfolist after usageJason A. Donenfeld
2019-05-10wintun: registry: replace REG_NOTIFY with NOTIFYSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-10wintun: IpConfig is a MULTI_SZ, and fix errorsJason A. Donenfeld
2019-05-10wintun: poll for device keyJason A. Donenfeld
It's actually pretty hard to guess where it is.
2019-05-10wintun: fix scope of error objectJason A. Donenfeld
2019-05-10wintun: wait for interface registry key on device creationSimon Rozman
By using RegNotifyChangeKeyValue(). Also disable dead gateway detection. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-09wintun: fix GUID leading zero paddingSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-03setupapi: safer aliasing of slice typesJason A. Donenfeld
2019-05-03wintun: work around GetInterface staleness bugJason A. Donenfeld
2019-05-02wintun: don't retry when not creatingJason A. Donenfeld
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.
2019-04-29wintun: try harder to open registry keyJason A. Donenfeld
This sucks. Can we please find a deterministic way of doing this instead?
2019-04-19setupapi: Fix struct size mismatchesSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-04-19setupapi: actually fix padding by rounding up to sizeof(void*)Jason A. Donenfeld
2019-04-18setupapi: Revise DrvInfoDetailData struct size calculationSimon Rozman
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>
2019-04-13windows: use proper constants from updated x/sysJason A. Donenfeld
2019-04-01wintun: rename device using undocumented API that netsh.exe usesJason A. Donenfeld
2019-04-01wintun: add more retry loopsJason A. Donenfeld
2019-03-22wintun: query for NetCfgInstanceId several timesJason A. Donenfeld
2019-03-22tun: windows: Make adapter rename asynchronousSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22tun: windows: Adapter devices renamed to WINTUN<LUID Index>Simon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-18tun: windows: wintun does iocpJason A. Donenfeld
2019-03-10wintun: Poll more oftenJason A. Donenfeld
2019-03-08wintun: Make errors more descriptiveSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-08wintun: Return correct reboot-req flag on CreateInterface() error tooSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-08wintun: Fix double-quoted strings escaping on outputSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-08wintun: Introduce SetupAPI enumerator and machineName constsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-07wintun: CleanupSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-07wintun: Refactor network registry key name generationSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-07wintun: Revise interface creation waitSimon Rozman
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>
2019-03-04wintun: Resolve some of golint warningsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-04Simplify reading NetCfgInstanceId from registrySimon Rozman
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>
2019-03-04Unify interface-specific network registry key openSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-18Change package pathJason A. Donenfeld
2019-02-07setupapi: Merge _SP_DRVINFO_DETAIL_DATA and DrvInfoDetailDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge SP_DRVINFO_DATA and DrvInfoDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_REMOVEDEVICE_PARAMS to RemoveDeviceParamsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_CLASSINSTALL_HEADER to ClassInstallHeaderSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge _SP_DEVINSTALL_PARAMS and DevInstallParamsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge _SP_DEVINFO_LIST_DETAIL_DATA and DevInfoListDetailDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_DEVINFO_DATA to DevInfoDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Detect if a foreign interface with the same name existsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Clean excessive setupapi.DevInfo.GetDeviceInfoListDetail() callSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Explain rationale behind case-insensitive interface namesSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Implement TODO in TestSetupDiGetDeviceRegistryProperty()Simon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: add FlushInterface stubJason A. Donenfeld
2019-02-07wintun: Compare values of GUID, not pointers, when removingJason A. Donenfeld
2019-02-07wintun: Introduce new package for obscuring Windows bitsJason A. Donenfeld