From ecf4001e6f26c29978ce580ff34d035448f3ba0f Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 6 Apr 2025 17:10:08 +0200 Subject: [PATCH] [SETUPAPI] Do not fail enumeration on invalid device interface keys (#7741) Necessary for drivers, which install multiple device interfaces and all interfaces might not be available for this device. CORE-17285 --- dll/win32/setupapi/interface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/win32/setupapi/interface.c b/dll/win32/setupapi/interface.c index 09b84d519a4..6a627d1118e 100644 --- a/dll/win32/setupapi/interface.c +++ b/dll/win32/setupapi/interface.c @@ -212,8 +212,12 @@ SETUP_CreateInterfaceList( /* Read SymbolicLink value */ rc = RegQueryValueExW(hReferenceKey, SymbolicLink, NULL, &dwRegType, NULL, &dwLength); - if (rc != ERROR_SUCCESS ) - goto cleanup; + if (rc != ERROR_SUCCESS) + { + /* Skip device interface with invalid reference value (i.e. interface not actually available for this device) */ + RegCloseKey(hReferenceKey); + continue; + } if (dwRegType != REG_SZ) { rc = ERROR_GEN_FAILURE;