diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-09-28 00:46:04 +0000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-09-28 00:47:10 +0000 |
commit | 8d7d50045146b0607e7725d21b5050f218c53c96 (patch) | |
tree | 990b87ab724ae58fe7656a8de96b10fa6e018fb6 /api/adapter.c | |
parent | version: bump (diff) | |
download | wireguard-nt-8d7d50045146b0607e7725d21b5050f218c53c96.tar.xz wireguard-nt-8d7d50045146b0607e7725d21b5050f218c53c96.zip |
api: adapter: cleanup wintrust shim if install fails
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | api/adapter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/api/adapter.c b/api/adapter.c index 8dcddb8..fb6a14d 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -1284,7 +1284,7 @@ SelectDriver( if (!SetupCopyOEMInfW(InfPath, NULL, SPOST_NONE, 0, InfStorePath, MAX_PATH, NULL, NULL)) { LastError = LOG_LAST_ERROR(L"Could not install driver %s to store", InfPath); - goto cleanupDelete; + goto cleanupWintrustChangedKey; } _Analysis_assume_nullterminated_(InfStorePath); @@ -1296,29 +1296,29 @@ SelectDriver( { LOG(WIREGUARD_LOG_ERR, L"Inf path too long: %s", InfStorePath); LastError = ERROR_INVALID_PARAMETER; - goto cleanupDelete; + goto cleanupWintrustChangedKey; } if (!SetupDiSetDeviceInstallParamsW(DevInfo, DevInfoData, DevInstallParams)) { LastError = LOG_LAST_ERROR(L"Failed to set adapter %u device installation parameters", DevInfoData->DevInst); - goto cleanupDelete; + goto cleanupWintrustChangedKey; } if (!SetupDiBuildDriverInfoList(DevInfo, DevInfoData, SPDIT_COMPATDRIVER)) { LastError = LOG_LAST_ERROR(L"Failed rebuilding adapter %u driver info list", DevInfoData->DevInst); - goto cleanupDelete; + goto cleanupWintrustChangedKey; } DestroyDriverInfoListOnCleanup = TRUE; SP_DRVINFO_DATA_W DrvInfoData = { .cbSize = sizeof(SP_DRVINFO_DATA_W) }; if (!SetupDiEnumDriverInfoW(DevInfo, DevInfoData, SPDIT_COMPATDRIVER, 0, &DrvInfoData)) { LastError = LOG_LAST_ERROR(L"Failed to get adapter %u driver", DevInfoData->DevInst); - goto cleanupDelete; + goto cleanupWintrustChangedKey; } if (!SetupDiSetSelectedDriverW(DevInfo, DevInfoData, &DrvInfoData)) { LastError = LOG_LAST_ERROR(L"Failed to set adapter %u driver", DevInfoData->DevInst); - goto cleanupDelete; + goto cleanupWintrustChangedKey; } LastError = ERROR_SUCCESS; DestroyDriverInfoListOnCleanup = FALSE; |