diff options
author | 2025-05-21 10:36:25 +0200 | |
---|---|---|
committer | 2025-05-21 10:36:25 +0200 | |
commit | 50086f0f88a2afdc5d9862064f599938b99dc712 (patch) | |
tree | faecaa2752c9e3a6634be2767777007310b10f3c /setupapihost | |
parent | driver: allowedips: expand maximum node depth (diff) | |
download | wireguard-nt-master.tar.xz wireguard-nt-master.zip |
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.c | 2 |
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), |