aboutsummaryrefslogtreecommitdiffstats
path: root/api/rundll32.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-10-30 14:34:40 +0100
committerSimon Rozman <simon@rozman.si>2020-10-31 19:11:49 +0100
commit0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb (patch)
tree439c904bbf7335f6a1b342dfcd59582e062cda5e /api/rundll32.c
parentapi: only sleep after force closing handles if required (diff)
downloadwintun-0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb.tar.xz
wintun-0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb.zip
api: only force close handles if requested
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/rundll32.c')
-rw-r--r--api/rundll32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/rundll32.c b/api/rundll32.c
index ac678a5..164b305 100644
--- a/api/rundll32.c
+++ b/api/rundll32.c
@@ -121,10 +121,11 @@ VOID __stdcall DeleteAdapter(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int
goto cleanup;
WINTUN_ADAPTER Adapter = { 0 };
- if (FAILED(CLSIDFromString(Argv[2], &Adapter.CfgInstanceID)))
+ BOOL ForceCloseSessions = wcstoul(Argv[2], NULL, 10);
+ if (FAILED(CLSIDFromString(Argv[3], &Adapter.CfgInstanceID)))
goto cleanup;
BOOL RebootRequired = FALSE;
- WriteFormatted(STD_OUTPUT_HANDLE, L"%1!X! %2!X!", WintunDeleteAdapter(&Adapter, &RebootRequired), RebootRequired);
+ WriteFormatted(STD_OUTPUT_HANDLE, L"%1!X! %2!X!", WintunDeleteAdapter(&Adapter, ForceCloseSessions, &RebootRequired), RebootRequired);
cleanup:
Done();