diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-10-30 14:34:40 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2020-10-31 19:11:49 +0100 |
commit | 0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb (patch) | |
tree | 439c904bbf7335f6a1b342dfcd59582e062cda5e /api/rundll32.c | |
parent | api: only sleep after force closing handles if required (diff) | |
download | wintun-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.c | 5 |
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(); |