[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
This commit is contained in:
Johannes Anderwald 2025-04-06 17:10:08 +02:00 committed by GitHub
parent 9aa299bea4
commit ecf4001e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;