aboutsummaryrefslogtreecommitdiffstats
path: root/api/rundll32.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: bump copyrightJason A. Donenfeld2021-01-301-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: remove return value from logger functionJason A. Donenfeld2020-11-101-3/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use GetLastError() to report failures like standard Win32Simon Rozman2020-11-041-18/+20
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: add pool/driver removal for uninstaller semanticsJason A. Donenfeld2020-11-031-2/+9
| | | | 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: ensure more code compiles by using dead code eliminationJason A. Donenfeld2020-11-031-3/+4
| | | | | | | | | | | | | | 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>
* example: rewrite and replace api's debug rundll32 functionalityJason A. Donenfeld2020-11-021-37/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: install driver on demandSimon Rozman2020-11-021-0/+13
| | | | | | ...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-021-2/+1
| | | | | | Makes the API a bit more clear. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: check for duplicate adapter statusJason A. Donenfeld2020-11-021-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: fix up console writing for debugJason A. Donenfeld2020-10-311-15/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: clear up argument evaluation orderJason A. Donenfeld2020-10-311-5/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: RebootRequire is an _Out_Jason A. Donenfeld2020-10-311-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: add debugging rundll32 entry pointJason A. Donenfeld2020-10-311-14/+52
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: add missing header for rundll32 modeJason A. Donenfeld2020-10-311-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: get rid of pch and make headers saneJason A. Donenfeld2020-10-311-1/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: rename MAX_POOL to WINTUN_MAX_POOLSimon Rozman2020-10-311-2/+6
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: upgrade source analysis annotationsSimon Rozman2020-10-311-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: only force close handles if requestedJason A. Donenfeld2020-10-311-2/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: elevate only when needed for system operationsJason A. Donenfeld2020-10-311-97/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: make #ifdef-s more descriptiveSimon Rozman2020-10-311-1/+1
| | | | | Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
* api: connect rundll32 child with parent using stdout and stderrSimon Rozman2020-10-301-13/+51
| | | | | | | | | | | | | | | | | The WintunCreateAdapter()+CreateAdapter() and WintunDeleteAdapter()+ DeleteAdapter() communicate using Unicode anonymous pipes now. This allows the WintunCreateAdapter() to exactly determine the adapter CreateAdapter() just created by its GUID rather than its name - avoiding the possible ambiguity caused by same-adapter-name ordinal suffixes. This also allows exact retrieval of the result code and pending reboot flag from the rundll32 child process. Furthermore, CreateAdapter() and DeleteAdapter() are now available in _DEBUG for all platforms to allow testing. It took a #pragma comment( linker, "/EXPORT") trick to stop compiler from decorating function names and exporting as _CreateAdapter@16() and _DeleteAdapter@16() in x86. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use standard C voidSimon Rozman2020-10-301-3/+3
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: make logger callback return a dummy valueSimon Rozman2020-10-301-2/+3
| | | | | | | Go supports only callbacks that return "something" of a size up to uintptr. It panics on void-returning callbacks. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: redirect log to stderr in rundll32 invocationsSimon Rozman2020-10-301-44/+24
| | | | | | | The WoW64 client will provide stdio handles to read the log messages. Furthermore, the rundll32 calls could return results using stdout. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: arrange rundll32 a console loggerSimon Rozman2020-10-301-6/+57
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: elevate rundll32 calls to SYSTEMSimon Rozman2020-10-301-0/+98
| | | | | | | I need this for debugging. In production environment, WoW64 clients will already call rundll32 elevated to SYSTEM. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: add support for WoW64Simon Rozman2020-10-301-0/+62
Some functions of SetupAPI only work when invoked from a native process. Registry and filesystem reflection makes them fail on WoW64. For WoW64 processes, a minimum set of rundll32 functions are provided. Signed-off-by: Simon Rozman <simon@rozman.si>