aboutsummaryrefslogtreecommitdiffstats
path: root/api/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/api.c')
-rw-r--r--api/api.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/api/api.c b/api/api.c
index 34b3536..bb8b0db 100644
--- a/api/api.c
+++ b/api/api.c
@@ -31,17 +31,28 @@ WintunGetVersion(
DWORD Result =
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\Wintun", 0, KEY_QUERY_VALUE, &Key);
if (Result != ERROR_SUCCESS)
- return Result;
+ return WINTUN_LOGGER_ERROR(L"Failed to open registry key", Result);
Result = RegistryQueryDWORD(Key, L"DriverMajorVersion", DriverVersionMaj);
if (Result != ERROR_SUCCESS)
+ {
+ WINTUN_LOGGER_ERROR(L"Failed to query DriverMajorVersion value", Result);
goto cleanupKey;
+ }
Result = RegistryQueryDWORD(Key, L"DriverMinorVersion", DriverVersionMin);
if (Result != ERROR_SUCCESS)
+ {
+ WINTUN_LOGGER_ERROR(L"Failed to query DriverMinorVersion value", Result);
goto cleanupKey;
+ }
Result = RegistryQueryDWORD(Key, L"NdisMajorVersion", NdisVersionMaj);
if (Result != ERROR_SUCCESS)
+ {
+ WINTUN_LOGGER_ERROR(L"Failed to query NdisMajorVersion value", Result);
goto cleanupKey;
+ }
Result = RegistryQueryDWORD(Key, L"NdisMinorVersion", NdisVersionMin);
+ if (Result != ERROR_SUCCESS)
+ WINTUN_LOGGER_ERROR(L"Failed to query NdisMinorVersion value", Result);
cleanupKey:
RegCloseKey(Key);
return Result;