From e73613ee24cc5211c17b16f8190726f148c52a10 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 10 Nov 2020 22:06:25 +0100 Subject: [PATCH] api: remove return value from logger function Signed-off-by: Jason A. Donenfeld --- README.md | 6 +----- api/rundll32.c | 5 ++--- api/wintun.h | 4 +--- example/example.c | 5 ++--- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 06f4847..c3b17e2 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Non-zero to continue iterating adapters; zero to stop. #### WINTUN\_LOGGER\_CALLBACK -`typedef BOOL(* WINTUN_LOGGER_CALLBACK) (WINTUN_LOGGER_LEVEL Level, const WCHAR *Message)` +`typedef void(* WINTUN_LOGGER_CALLBACK) (WINTUN_LOGGER_LEVEL Level, const WCHAR *Message)` Called by internal logger to report diagnostic messages @@ -128,10 +128,6 @@ Called by internal logger to report diagnostic messages - *Level*: Message level. - *Message*: Message text. -**Returns** - -Anything - return value is ignored. - #### WINTUN\_SESSION\_HANDLE `typedef void* WINTUN_SESSION_HANDLE` diff --git a/api/rundll32.c b/api/rundll32.c index 1d564ae..dc47a21 100644 --- a/api/rundll32.c +++ b/api/rundll32.c @@ -39,7 +39,7 @@ WriteFormatted(_In_ DWORD StdHandle, _In_z_ const WCHAR *Template, ...) return SizeWritten / sizeof(WCHAR); } -static BOOL CALLBACK +static void CALLBACK ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) { const WCHAR *Template; @@ -55,10 +55,9 @@ ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) Template = L"[!] %1\n"; break; default: - return FALSE; + return; } WriteFormatted(STD_ERROR_HANDLE, Template, LogLine); - return TRUE; } static int Argc; diff --git a/api/wintun.h b/api/wintun.h index b5d4d02..fb649ba 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -192,10 +192,8 @@ typedef enum * @param Level Message level. * * @param Message Message text. - * - * @return Anything - return value is ignored. */ -typedef BOOL(CALLBACK *WINTUN_LOGGER_CALLBACK)(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *Message); +typedef void(CALLBACK *WINTUN_LOGGER_CALLBACK)(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *Message); /** * Sets logger callback function. diff --git a/example/example.c b/example/example.c index b429e7b..5a00332 100644 --- a/example/example.c +++ b/example/example.c @@ -61,7 +61,7 @@ InitializeWintun(void) return Wintun; } -static BOOL CALLBACK +static void CALLBACK ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) { FILETIME Timestamp; @@ -81,7 +81,7 @@ ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) LevelMarker = L'!'; break; default: - return FALSE; + return; } fwprintf( stderr, @@ -95,7 +95,6 @@ ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) SystemTime.wMilliseconds, LevelMarker, LogLine); - return TRUE; } static DWORD