aboutsummaryrefslogtreecommitdiffstats
path: root/api/namespace.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* api: rewrite based on SwDeviceJason A. Donenfeld2021-10-121-98/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: upgradeSimon Rozman2021-07-281-15/+20
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* vs: move shared configuration to wintun.props and upgradeSimon Rozman2021-07-281-1/+1
| | | | | | | Remember to rename wintun.vcxproj.user file in your local working folder to wintun.props.user manually. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: build with WDKJason A. Donenfeld2021-07-231-0/+2
| | | | | | | Makes builds more reproducable, as we can do our next release using the EWDK, an all-in-one ISO of build tools from Microsoft. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: don't auto-elevateJason A. Donenfeld2021-06-251-2/+2
| | | | | | | There's no longer a need to do this for every API call. This only exists now for the pnp guid reuse workaround hack. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: upgrade logging0.10.2Simon Rozman2021-02-161-13/+15
| | | | | | | Log runtime information to quickly check whether the values are sane when analyzing error logs sent in by users. Signed-off-by: Simon Rozman <simon@rozman.si>
* global: bump copyrightJason A. Donenfeld2021-01-301-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: close private namespace when unloading DLLJason A. Donenfeld2020-12-171-12/+16
| | | | | | | | | | | | | | Prior, people making calls to LoadLibrary/FreeLibrary would experience a failure to create or open adapters, because the private namespace was already loaded into the process and not cleaned up on DLL detachment. While this pattern is probably a misuse of the library, we should still support cleaning that up. This commit makes the right calls to free the boundary descriptor and close the private namespace. It does not, however, destroy the private namespace using the flag on the second parameter, in case of races with other processes. Reported-by: Brad Spencer <bspencer@blackberry.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use a logging alloc functionJason A. Donenfeld2020-11-041-11/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: translate NTSTATUS to Win32 error codesSimon Rozman2020-11-041-10/+13
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use GetLastError() to report failures like standard Win32Simon Rozman2020-11-041-45/+78
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: serialize driver installationJason A. Donenfeld2020-11-021-1/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: opencode bin2hex in same manner as random directory creationJason A. Donenfeld2020-10-311-15/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: get rid of pch and make headers saneJason A. Donenfeld2020-10-311-1/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rework pool hashingJason A. Donenfeld2020-10-311-8/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove security attributes debug trap doorJason A. Donenfeld2020-10-311-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: fix zero-parameter C function prototypesSimon Rozman2020-10-311-3/+3
| | | | | Reported-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
* api: switch to private heapSimon Rozman2020-10-301-4/+3
| | | | | | | We must not use the process heap, as it is changeable. Client may change it causing our HeapFree() to use wrong heap. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: unify security descriptors and disable for _DEBUGSimon Rozman2020-10-301-17/+6
| | | | | | | | When debugger is attached, CreateDirectory() with SYSTEM-only SID fails with "This security ID may not be assigned as the owner of this object. (Code 0x0000051B)". Signed-off-by: Simon Rozman <simon@rozman.si>
* api: log out-of-memory errors tooSimon Rozman2020-10-301-14/+10
| | | | | | | It's not likely the write to log will succeed in low memory condition thou. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: added missing allocation-failure checkSimon Rozman2020-10-301-0/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: internal reorganizationSimon Rozman2020-10-301-2/+2
| | | | | | | | | | | Gather adapter management in adapter.h/.c (formerly devmgmt.h/.c) and unify HwID tests. Use "Namespace" namespace in all functions from namespace.h/.c. Fix char strings in LOG_... Signed-off-by: Simon Rozman <simon@rozman.si>
* api: cleanupSimon Rozman2020-10-301-6/+6
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: add pre-compiled header supportSimon Rozman2020-10-301-3/+1
| | | | | | ...for super-fast compilation. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: rename WINSTATUS to WINTUN_STATUSSimon Rozman2020-10-301-1/+1
| | | | | | ...to reduce name collision probability. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: port tun\wintun\namespace_windows.go from wireguard-goSimon Rozman2020-10-301-0/+200
Signed-off-by: Simon Rozman <simon@rozman.si>