aboutsummaryrefslogtreecommitdiffstats
path: root/api (follow)
Commit message (Collapse)AuthorAgeFilesLines
* api: avoid loading version.dll if not usedJason A. Donenfeld2020-11-061-3/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: include arm64 in amd64Jason A. Donenfeld2020-11-052-2/+2
| | | | | | ARM64 will still run AMD64 apps. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove WintunOpenAdapterDeviceObjectJason A. Donenfeld2020-11-055-21/+14
| | | | | | | Discourage use of kernel interface, which gives us more flexibility if we ever want to change it. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rearrange wintun.h to have better grouping and improve docsJason A. Donenfeld2020-11-051-26/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rename WintunGetAdapter to WintunOpenAdapterJason A. Donenfeld2020-11-053-10/+10
| | | | | | "Create" and "Open" natural names for these. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rename ReceiveRelease to ReleaseReceivePacketJason A. Donenfeld2020-11-053-9/+7
| | | | | | | | This makes the API parallel: Wintun*Allocate*SendPacket -> WintunSendPacket WintunReceivePacket -> Wintun*Release*ReceivePacket Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: add cfgmgr32.dll to delayed load listJason A. Donenfeld2020-11-051-2/+2
| | | | | | It's in the registry but not in the NT object key. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: fix typo in ring-management function prototype declarationsSimon Rozman2020-11-051-5/+5
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: document enum argument properlyJason A. Donenfeld2020-11-041-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: document log enumJason A. Donenfeld2020-11-041-3/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove enum name for logger levelJason A. Donenfeld2020-11-041-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: document adapter handle return value properlyJason A. Donenfeld2020-11-041-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: CALLBACK_FUNC -> CALLBACKJason A. Donenfeld2020-11-044-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: upgrade nci.lib and wintun-inf.h buildingSimon Rozman2020-11-042-9/+32
| | | | | | | The additional build steps performed are now attached to the build process using BeforeTargets/AfterTargets. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: rename GetVersion to GetRunningDriverVersionJason A. Donenfeld2020-11-043-4/+4
| | | | | | | This makes our intentions a lot more clear, and in case we ever add other version functions, makes the forward path simpler. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use a logging alloc functionJason A. Donenfeld2020-11-048-131/+96
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: concatenate function name at runtimeJason A. Donenfeld2020-11-043-18/+29
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: include the rundll32 helpers the MSVC-typical waySimon Rozman2020-11-044-6/+8
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: translate NTSTATUS to Win32 error codesSimon Rozman2020-11-043-13/+15
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use GetLastError() to report failures like standard Win32Simon Rozman2020-11-0417-981/+1266
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: extract inf driverver at compile time into C headerJason A. Donenfeld2020-11-032-111/+5
| | | | | | | | | | | | This requires us to make some insane conversions between INF date, JavaScript time, and finally Windows file time. The point is to mimic SystemTimeToFileTime, which is what SpInf.dll's pSetupStringToDriverDate does on the YYYY-MM-DD from the INF. The result is that we no longer have to parse an ancient text format in C at runtime. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: move nci.lib generation to custom stepJason A. Donenfeld2020-11-031-4/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: move undocumented ntdll symbols to ntdll.hJason A. Donenfeld2020-11-034-18/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: constify pool argumentJason A. Donenfeld2020-11-034-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove guid getterJason A. Donenfeld2020-11-033-16/+0
| | | | | | | | | The iphlpapi takes both LUIDs and GUIDs but prefers LUIDs, so exposing the NET_LUID makes sense. However, we were previously exposing the configuration GUID, rather than the net GUID, which is confusing, so just make it all go away. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use 'open' name since caller must close handleJason A. Donenfeld2020-11-035-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: add pool/driver removal for uninstaller semanticsJason A. Donenfeld2020-11-036-20/+65
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: move _L macro where it belongsJason A. Donenfeld2020-11-032-7/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: conditionalize quasi expensive prelinkeventJason A. Donenfeld2020-11-031-1/+1
| | | | | | | It would be better to do this only if either nci.def or nci.h are newer than nci.lib, but who knows if msbuild is expressive enough for this. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: only return top two version nibblesJason A. Donenfeld2020-11-032-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: bulk-disable unreferenced param warning where it nags the mostSimon Rozman2020-11-031-12/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: prevent double SetupDiDestroyDriverInfoList calls on errorSimon Rozman2020-11-031-6/+10
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: rundll32: repair token spawning semanticsJason A. Donenfeld2020-11-034-9/+75
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: refactor .inf parsing and check SystemTimeToFileTime for errorsSimon Rozman2020-11-031-29/+31
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: simplify IsOurDrvInfoDetail()Simon Rozman2020-11-031-3/+6
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: ensure more code compiles by using dead code eliminationJason A. Donenfeld2020-11-034-29/+33
| | | | | | | | | | | | | | It'd be nicer to do this via if (is_defined(HAVE_WHATEVER)) But MSVC won't work with the linux kernel macros for this. Ongoing research. Nevertheless, this makes most of the program always pass through the compiler's type checker, only to have dead code removed later. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: begin to separate rundll32 jumpsJason A. Donenfeld2020-11-034-332/+333
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* example: rewrite and replace api's debug rundll32 functionalityJason A. Donenfeld2020-11-025-106/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: free beginning of heap objectJason A. Donenfeld2020-11-021-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: pass around NET_LUID instead of LUIDJason A. Donenfeld2020-11-022-4/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: consistancy in exported interfaceJason A. Donenfeld2020-11-022-8/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: return correct error when there's a duplicateJason A. Donenfeld2020-11-021-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: install driver on demandSimon Rozman2020-11-025-383/+587
| | | | | | ...and add API for uninstalling it. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: separate read-wait handle into other functionJason A. Donenfeld2020-11-025-14/+29
| | | | | | Makes the API a bit more clear. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: statically compile devpkey constantsJason A. Donenfeld2020-11-021-4/+2
| | | | | | | I don't like this solution, but I don't see much other choice. It's not in uuid.lib or anywhere like that. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: serialize driver installationJason A. Donenfeld2020-11-023-7/+43
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: make nci.lib work on x86Jason A. Donenfeld2020-11-024-5/+19
| | | | | | | | | | This is an appalling hack. We need the lib tool to generate a coff lib with the "undecorate" parameter. And apparently the only way to do this with the MSVC tools is by making a stub object, and then rewriting the symbols using the def file. See Q131313 for Microsoft-sanctioned details. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: map cr errors to win32 errorsJason A. Donenfeld2020-11-021-12/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: simplify and unify error messagesSimon Rozman2020-11-023-47/+47
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: pnf param is noneJason A. Donenfeld2020-11-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>