aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2021-04-13 12:09:13 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-13 15:50:50 -0600
commitd35312d33f95a0250ccfac1f9a58729fb16f287f (patch)
treecb6b5704e78a232906e98c54428ba2c774da046e
parentapi: fix fallback log line printf template (diff)
downloadwintun-d35312d33f95a0250ccfac1f9a58729fb16f287f.tar.xz
wintun-d35312d33f95a0250ccfac1f9a58729fb16f287f.zip
api: log Windows error message too when creating folder or file fails
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r--api/adapter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/adapter.c b/api/adapter.c
index 8fc757e..47809f4 100644
--- a/api/adapter.c
+++ b/api/adapter.c
@@ -1306,7 +1306,7 @@ static _Return_type_success_(return != FALSE) BOOL SelectDriver(
WCHAR RandomTempSubDirectory[MAX_PATH];
if (!CreateTemporaryDirectory(RandomTempSubDirectory))
{
- LastError = LOG(WINTUN_LOG_ERR, L"Failed to create temporary folder %s", RandomTempSubDirectory);
+ LastError = LOG_LAST_ERROR(L"Failed to create temporary folder %s", RandomTempSubDirectory);
goto cleanupExistingAdapters;
}
@@ -1330,7 +1330,7 @@ static _Return_type_success_(return != FALSE) BOOL SelectDriver(
!ResourceCopyToFile(SysPath, UseWHQL ? L"wintun-whql.sys" : L"wintun.sys") ||
!ResourceCopyToFile(InfPath, UseWHQL ? L"wintun-whql.inf" : L"wintun.inf"))
{
- LastError = LOG(WINTUN_LOG_ERR, L"Failed to extract driver");
+ LastError = LOG_LAST_ERROR(L"Failed to extract driver");
goto cleanupDelete;
}
LOG(WINTUN_LOG_INFO, L"Installing driver");