[PCI] Filter out devices with null vendor and device ID

Some virtual machines errorneously expose null PCI device function
on PIIX4 chipset where an USB controller should normally reside.

Windows pci.sys driver does not enumerate these devices.

Affected virtual machines:
- Connectix Virtual PC 5.1.370
- Connectix Virtual PC 5.2.418
- Microsoft Virtual PC 2004 SP1 (5.3.582.27)
- Microsoft Virtual PC 2007 SP1 (6.0.156.0)

Non-affected virtual machines:
- Connectix Virtual PC 4.0
- Microsoft Hyper-V

Fixes CORE-17636.
This commit is contained in:
Stanislav Motylkov 2021-06-17 17:04:09 +03:00
parent c7954134d0
commit a4405f9610
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -151,6 +151,12 @@ FdoEnumerateDevices(
PciConfig.VendorID, PciConfig.VendorID,
PciConfig.DeviceID); PciConfig.DeviceID);
if (PciConfig.VendorID == 0 && PciConfig.DeviceID == 0)
{
DPRINT("Filter out devices with null vendor and device ID\n");
continue;
}
Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber, &PciConfig); Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber, &PciConfig);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {