aboutsummaryrefslogtreecommitdiffstats
path: root/api/rundll32.c
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-11-02 16:28:51 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-02 23:33:20 +0100
commit283f6c8e6315f8811c056df40a7e40270fed822e (patch)
treefa9f68ca06340e65b5a2d83b815bcfda66fb2c01 /api/rundll32.c
parentapi: separate read-wait handle into other function (diff)
downloadwintun-283f6c8e6315f8811c056df40a7e40270fed822e.tar.xz
wintun-283f6c8e6315f8811c056df40a7e40270fed822e.zip
api: install driver on demand
...and add API for uninstalling it. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api/rundll32.c')
-rw-r--r--api/rundll32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/api/rundll32.c b/api/rundll32.c
index 31f240f..05a8323 100644
--- a/api/rundll32.c
+++ b/api/rundll32.c
@@ -145,6 +145,19 @@ cleanup:
Done();
}
+VOID __stdcall DeleteDriver(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
+{
+# pragma EXPORT
+ UNREFERENCED_PARAMETER(hwnd);
+ UNREFERENCED_PARAMETER(hinst);
+ UNREFERENCED_PARAMETER(lpszCmdLine);
+ UNREFERENCED_PARAMETER(nCmdShow);
+
+ Init();
+ WriteFormatted(STD_OUTPUT_HANDLE, L"%1!X!", WintunDeleteDriver());
+ Done();
+}
+
#ifdef _DEBUG
VOID __stdcall DoThingsForDebugging(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
{