[SETUPAPI] Correctly enumerate non-installed devices in SetupDiGetClassDevsExW

Always try to read the correct device GUID from registry, even if GUID filter is disabled.

CORE-17527
This commit is contained in:
Hervé Poussineau 2021-04-11 15:10:47 +02:00
parent f9df7af28a
commit e044df8736

View file

@ -179,8 +179,6 @@ SETUP_CreateDevicesList(
}
/* Retrieve GUID of this device */
if (Class)
{
ClassGuidBufferSize = sizeof(ClassGuidBuffer);
cr = CM_Get_DevNode_Registry_Property_ExW(dnDevInst,
CM_DRP_CLASSGUID,
@ -205,12 +203,11 @@ SETUP_CreateDevicesList(
memcpy(&ClassGuid, &GUID_NULL, sizeof(GUID));
}
if (!IsEqualIID(&ClassGuid, Class))
if (Class && !IsEqualIID(&ClassGuid, Class))
{
TRACE("Skipping %S due to wrong class GUID\n", InstancePath);
continue;
}
}
/* Good! Create a device info element */
if (!CreateDeviceInfo(list, InstancePath, &ClassGuid, &deviceInfo))