aboutsummaryrefslogtreecommitdiffstats
path: root/example/example.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-10-01 04:36:10 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-10-06 05:16:14 +0000
commit12993b13641a2ee608b0c8906cc280465e2a6423 (patch)
treebcd34aa8ac9446c704900f6f4f6b43cfe841affb /example/example.c
parentapi: adapter: check for errors before waiting on reg keys (diff)
downloadwireguard-nt-12993b13641a2ee608b0c8906cc280465e2a6423.tar.xz
wireguard-nt-12993b13641a2ee608b0c8906cc280465e2a6423.zip
api: adapter: treat reboot required as real error
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'example/example.c')
-rw-r--r--example/example.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/example/example.c b/example/example.c
index 360d4e8..23ef91f 100644
--- a/example/example.c
+++ b/example/example.c
@@ -371,14 +371,14 @@ int __cdecl main(void)
GUID ExampleGuid = { 0xdeadc001, 0xbeef, 0xbabe, { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef } };
WIREGUARD_ADAPTER_HANDLE Adapter = WireGuardOpenAdapter(L"Example", L"Demo");
- if (Adapter && !WireGuardDeleteAdapter(Adapter, NULL))
+ if (Adapter && !WireGuardDeleteAdapter(Adapter))
{
LastError = GetLastError();
LogError(L"Failed to delete already existing adapter", LastError);
goto cleanupQuit;
}
WireGuardFreeAdapter(Adapter);
- Adapter = WireGuardCreateAdapter(L"Example", L"Demo", &ExampleGuid, NULL);
+ Adapter = WireGuardCreateAdapter(L"Example", L"Demo", &ExampleGuid);
if (!Adapter)
{
LastError = GetLastError();
@@ -466,7 +466,7 @@ int __cdecl main(void)
} while (WaitForSingleObject(QuitEvent, 1000) == WAIT_TIMEOUT);
cleanupAdapter:
- WireGuardDeleteAdapter(Adapter, NULL);
+ WireGuardDeleteAdapter(Adapter);
WireGuardFreeAdapter(Adapter);
cleanupQuit:
SetConsoleCtrlHandler(CtrlHandler, FALSE);