diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-02 17:18:39 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-02 23:33:20 +0100 |
commit | 351349b4c46ddff1ab9366ee43f7279a34c6a42d (patch) | |
tree | ef33e4d396412e1588128f089796b0ed637c3409 /api/adapter.c | |
parent | api: install driver on demand (diff) | |
download | wintun-351349b4c46ddff1ab9366ee43f7279a34c6a42d.tar.xz wintun-351349b4c46ddff1ab9366ee43f7279a34c6a42d.zip |
api: return correct error when there's a duplicate
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/adapter.c')
-rw-r--r-- | api/adapter.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api/adapter.c b/api/adapter.c index 9d2a0b4..973316e 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -1597,10 +1597,10 @@ CreateAdapter( PropertyType == DEVPROP_TYPE_NTSTATUS) { Result = RtlNtStatusToDosError(ProblemStatus); + _Analysis_assume_(Result != ERROR_SUCCESS); if (ProblemStatus != STATUS_PNP_DEVICE_CONFIGURATION_PENDING || Tries == 999) { LOG_ERROR(L"Failed to setup adapter", Result); - Result = ERROR_GEN_FAILURE; goto cleanupTcpipInterfaceRegKey; } Sleep(10); @@ -1608,6 +1608,7 @@ CreateAdapter( else break; } + Result = ERROR_SUCCESS; *Adapter = a; |