From a4405f9610f7703a647f43229a8e063fb85c98d7 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Thu, 17 Jun 2021 17:04:09 +0300 Subject: [PATCH] [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. --- drivers/bus/pci/fdo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/bus/pci/fdo.c b/drivers/bus/pci/fdo.c index 2cd73f650b2..17a4c07c622 100644 --- a/drivers/bus/pci/fdo.c +++ b/drivers/bus/pci/fdo.c @@ -151,6 +151,12 @@ FdoEnumerateDevices( PciConfig.VendorID, 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); if (!NT_SUCCESS(Status)) {