aboutsummaryrefslogtreecommitdiffstats
path: root/api/adapter.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* api: use GetLastError() to report failures like standard Win32Simon Rozman2020-11-041-9/+9
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: constify pool argumentJason A. Donenfeld2020-11-031-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use 'open' name since caller must close handleJason A. Donenfeld2020-11-031-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: add pool/driver removal for uninstaller semanticsJason A. Donenfeld2020-11-031-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: install driver on demandSimon Rozman2020-11-021-62/+6
| | | | | | ...and add API for uninstalling it. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: check buffer overflows in runtimeSimon Rozman2020-10-311-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: do not require RebootRequiredJason A. Donenfeld2020-10-311-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: RebootRequire is an _Out_Jason A. Donenfeld2020-10-311-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: get rid of pch and make headers saneJason A. Donenfeld2020-10-311-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rename MAX_POOL to WINTUN_MAX_POOLSimon Rozman2020-10-311-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: only force close handles if requestedJason A. Donenfeld2020-10-311-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: simplify driver removalSimon Rozman2020-10-311-0/+1
| | | | | | | | | | | | | | | | | When we install the Wintun driver to the store, we get exact oem<nn>.inf filename of the driver in the store we just installed. Since the installation should be only temporarily, we should uninstall only the driver we installed. This also eliminates the need for iterating driver store speeding up things. The code we removed was inherited from the installer.dll, where it made perfect sense to remove all installed Wintun drivers in the update process. Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use C locale for adapter and pool name case-insensitive comparingSimon Rozman2020-10-311-3/+0
| | | | | Reported-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
* 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-1/+1
| | | | | | | 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: add ring managementSimon Rozman2020-10-301-1/+6
| | | | | | | | Rather than every client reinvent the art of using the Wintun and its ring buffers, we offer helper structs and functions to unify and simplify Wintun usage. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: introduce wintun.hSimon Rozman2020-10-301-123/+7
| | | | | | | | | | | The SDK header for deployment containing datatype and function declarations for use by C/C++ clients. As we shall not distribute MSVC wintun.lib files, making clients need to use GetProcAddress(), this file contains function type declarations rather then __declspec(dllimport) function declarations. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: move documentation to .h and discontinue on static functionsSimon Rozman2020-10-301-0/+141
| | | | | | | | | While Doxygen correctly locates the function documentation when it is written directly preceding the function body, Microsoft Visual Studio IDE does not. The former requires the documentation to precede the function declaration. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: internal reorganizationSimon Rozman2020-10-301-0/+90
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>