aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-07-08 02:50:06 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-07-08 02:50:57 +0200
commitbf5b170101b287082637ef729feee983f8cda36a (patch)
treee3fe85841df11c7ddbc431afe8c76abef6bd17dd /api
parentversion: bump (diff)
downloadwintun-bf5b170101b287082637ef729feee983f8cda36a.tar.xz
wintun-bf5b170101b287082637ef729feee983f8cda36a.zip
api: print correct last error when failing
Prior to the conversion, LastError is ERROR_SUCCESS, so move the logging to be after the conversion. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api')
-rw-r--r--api/adapter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/adapter.c b/api/adapter.c
index 3134b6d..0fe902f 100644
--- a/api/adapter.c
+++ b/api/adapter.c
@@ -1747,10 +1747,10 @@ static _Return_type_success_(return != NULL) WINTUN_ADAPTER *CreateAdapter(
0) ||
PropertyType != DEVPROP_TYPE_INT32)
ProblemCode = 0;
- LOG_ERROR(LastError, L"Failed to setup adapter (code: 0x%x, status: 0x%x)", ProblemCode, ProblemStatus);
LastError = RtlNtStatusToDosError(ProblemStatus);
if (LastError == ERROR_SUCCESS)
LastError = ERROR_NOT_READY;
+ LOG_ERROR(LastError, L"Failed to setup adapter (code: 0x%x, status: 0x%x)", ProblemCode, ProblemStatus);
goto cleanupTcpipAdapterRegKey;
}
Sleep(10);