aboutsummaryrefslogtreecommitdiffstats
path: root/api (follow)
Commit message (Collapse)AuthorAgeFilesLines
* api: rundll32: fix inverted _Return_type_success_ on ProcessStdoutJason A. Donenfeld2026-04-161-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: check CommandLineToArgvW return for NULLJason A. Donenfeld2026-04-161-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: logger: fix format string argument order ilon OOMJason A. Donenfeld2026-04-161-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: enable /std:clatest and use typeofJason A. Donenfeld2026-04-141-3/+3
| | | | | | | | | | | | | | Use C23 typeof to eliminate redundant type parameters from the RCU macros. Also, drop mention of hoping to use alignas in TODO.md. It only goes on members of structs, not the struct type itself, which I find syntactically annoying, and it doesn't really confer any additional real benefits. Moving to C23 means that we must use __VA_OPT__. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: don't set DriverRequired on stub deviceJason A. Donenfeld2026-04-141-2/+1
| | | | | | | | | The stub device only exists momentarily to create the software registry key for SuggestedInstanceId. Setting SWDeviceCapabilitiesDriverRequired with empty hardware IDs violates the SwDeviceCreate API contract and causes PnP to needlessly search for a driver for this transient device. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: capture LastError from failed allocationJason A. Donenfeld2026-04-141-0/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: take into account QueueUserWorkItem failingJason A. Donenfeld2026-04-141-1/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: driver: skip restore when snapshot failedJason A. Donenfeld2026-04-141-8/+11
| | | | | | | | If SnapshotConfigurationAndState fails, Configuration is left NULL, but RestoreConfigurationAndState was called unconditionally, passing the NULL pointer to DeviceIoControl. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: driver: don't log potentially uninitialized temp dirJason A. Donenfeld2026-04-141-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: logger: retry waiting for logger to stopJason A. Donenfeld2026-04-141-2/+3
| | | | | | | The return code before was wrong, because WaitForSingleObject returns WAIT_OBJECT_0 on success, not TRUE. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rundll32: do not close invalid handle valueJason A. Donenfeld2026-04-141-4/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* build: call signtool manuallyJason A. Donenfeld2026-04-111-0/+3
| | | | | | | | This eliminates the need for a cross signing certificate, which is no longer needed in the kernel and was never useful in userspace. And it does the timestamp server correctly. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: compare enum values as DWORDsJason A. Donenfeld2026-03-271-14/+14
| | | | | | | api\configuration.c(45,39): error C2220: the following warning is treated as an error [api\api.vcxproj] api\configuration.c(45,39): warning C5287: operands are different enum types 'WG_IOCTL_INTERFACE_FLAG' and 'WIREGUARD_INTERFACE_FLAG'; use an explicit cast to silence this warning [api\api.vcxproj] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove irregular parens in enumJason A. Donenfeld2026-03-271-4/+4
| | | | | | The other enums aren't using these. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: port to windows 10Jason A. Donenfeld2026-03-2710-478/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyrightJason A. Donenfeld2026-03-2423-24/+24
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: allowedips: add WG_IOCTL_ALLOWED_IP_REMOVE flagJason A. Donenfeld2026-03-242-3/+17
| | | | | | | | | This allows removing individual allowed IPs without having to clear them all out and dropping packets or relying on a dummy peer to have move semantics. Suggested-by: Jordan Rife <jordan@jrife.io> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: header: add C++ enum manipulation operatorsSimon Rozman2022-03-301-0/+2
| | | | | | | | C++ doesn't have bitwise operators on enums by default. Rather than reinventing the wheel, we use an undocumented DEFINE_ENUM_FLAG_OPERATORS macro from Windows SDK to implement the enum operators. Signed-off-by: Simon Rozman <simon@rozman.si>
* driver: PEER_UPDATE is supposed to be UPDATE_ONLYJason A. Donenfeld2021-10-192-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: main: avoid excessive function castJason A. Donenfeld2021-10-151-4/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: header: fix typoJason A. Donenfeld2021-10-141-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use proper instance id boundsJason A. Donenfeld2021-10-145-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: handle cases explicitly in dev query callbackJason A. Donenfeld2021-10-141-5/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* downlevelshim: remove in preparation for full WHQLJason A. Donenfeld2021-10-132-66/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: driver: don't allocate for instance IDJason A. Donenfeld2021-10-122-31/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: unify remaining poll loop formsJason A. Donenfeld2021-10-112-4/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: ensure file handle opens on win7Jason A. Donenfeld2021-10-111-7/+15
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: open devinst after arrival and skip stub on win8Jason A. Donenfeld2021-10-112-20/+39
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: replace INF Include/Needs hack with stub deviceJason A. Donenfeld2021-10-111-90/+81
| | | | | | | | | | | | Apparently breaking the guarantee of "Universal INF"s receives the big tsk tsk, so this commit is yet another way to set SuggestedInstanceId. We create an SwDevice, with DEVPKEY_Device_ClassGuid set to GUID_DEVCLASS_NET and an empty HWID, and then create the software regkey and add the keys we need. We then destroy the SwDevice, and recreate a new one with the same instance ID, this time with the proper parameters. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: cleanup ROOT\NET enumerated devices on DLL loadJason A. Donenfeld2021-10-113-0/+39
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: migrate to swdevice and rework entire apiJason A. Donenfeld2021-10-0618-2084/+1764
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: set suggested instance ID using INF instead of ourselvesJason A. Donenfeld2021-10-063-37/+111
| | | | | | This might allow us to more successfully move to using SwDevice. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: get rid of registry polling on Win8+Jason A. Donenfeld2021-10-067-343/+190
| | | | | | | Wait for the device to come up as enabled instead using the proper Win8+ API. Fall back to polling for Win7. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: logger: remove function prefixesJason A. Donenfeld2021-10-062-52/+30
| | | | | | | The strings are already unique, so prefixing function names adds nothing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: treat reboot required as real errorJason A. Donenfeld2021-10-064-60/+37
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: check for errors before waiting on reg keysJason A. Donenfeld2021-10-061-40/+46
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: remove deadgwdetect settingJason A. Donenfeld2021-10-061-128/+2
| | | | | | It's unclear whether this registry key is still being respected. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: adapter: cleanup wintrust shim if install failsJason A. Donenfeld2021-09-281-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: support MinGW in distributed headerJason A. Donenfeld2021-09-161-3/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* props: unify import .lib of DLLsSimon Rozman2021-08-101-1/+0
| | | | | | | This moves downlevelshim.lib and those .lib from any future DLLs in this repo to the matching IntDir. Signed-off-by: Simon Rozman <simon@rozman.si>
* driver: logging: pass timestamp back to userspaceJason A. Donenfeld2021-08-083-62/+44
| | | | | | It turns out the precision is very useful for diagnosing weird errors. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rundll32: make empty string if no instance idJason A. Donenfeld2021-08-081-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: incorporate new win7 code signing technique0.1Jason A. Donenfeld2021-08-022-0/+67
| | | | | | https://git.zx2c4.com/downlevel-driver-enabler/about/ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove Authenticode supportJason A. Donenfeld2021-08-023-103/+5
| | | | | | These are no longer supported by the CAs. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Introduce WireGuardNTJason A. Donenfeld2021-08-0224-0/+5311
Co-authored-by: Simon Rozman <simon@rozman.si> Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>