From 12993b13641a2ee608b0c8906cc280465e2a6423 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 1 Oct 2021 04:36:10 +0000 Subject: api: adapter: treat reboot required as real error Signed-off-by: Jason A. Donenfeld --- example/example.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'example/example.c') 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); -- cgit v1.2.3-59-g8ed1b