aboutsummaryrefslogtreecommitdiffstats
path: root/setupapihost
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2025-05-21 10:36:25 +0200
committerSimon Rozman <simon@rozman.si>2025-05-21 10:36:25 +0200
commit50086f0f88a2afdc5d9862064f599938b99dc712 (patch)
treefaecaa2752c9e3a6634be2767777007310b10f3c /setupapihost
parentdriver: allowedips: expand maximum node depth (diff)
downloadwireguard-nt-master.tar.xz
wireguard-nt-master.zip
api: ignore instance not found when removing instanceHEADmaster
Should SetupAPI report ERROR_PATH_NOT_FOUND on attempt to remove the adapter instance, the adapter is already gone and we already have what we wanted. Reference: https://lists.zx2c4.com/pipermail/wireguard/2025-February/008762.html Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'setupapihost')
-rw-r--r--setupapihost/host.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/setupapihost/host.c b/setupapihost/host.c
index e930358..cefd68b 100644
--- a/setupapihost/host.c
+++ b/setupapihost/host.c
@@ -72,6 +72,8 @@ VOID __stdcall RemoveInstance(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int
if (!SetupDiOpenDeviceInfoW(DevInfo, InstanceId, NULL, DIOD_INHERIT_CLASSDRVS, &DevInfoData))
{
LastError = GetLastError();
+ if (LastError == ERROR_PATH_NOT_FOUND)
+ LastError = ERROR_SUCCESS;
goto cleanupDevInfo;
}
SP_REMOVEDEVICE_PARAMS RemoveDeviceParams = { .ClassInstallHeader = { .cbSize = sizeof(SP_CLASSINSTALL_HEADER),