4

I'm trying to get a list of all the PCI associated buses on a Windows system. I know I can use wmic or devcon to get a list of all the devices, but how would I go about figuring their respective buses?

edit: preferably without using 3rd party software

This info is available via the registry:

enter image description here

3

4 Answers 4

3

I've ended up up using a short script using reg.exe to go through the PCI devices list in the registry. thanks for all the suggestions.

edit: here it is for everyone: https://gist.github.com/anonymous/c59b373ef320c9697710

1
  • added link to gist
    – marekp
    Aug 18, 2015 at 9:43
1

Same parameters can also be found with Win32_PnPEntity WMI class:

PS C:\Users\Administrator> (gwmi win32_pnpEntity -Filter 'manufacturer like "Red Hat%"')[5].getDeviceProperties().deviceproperties | ft keyName,data

keyName                                        data
-------                                        ----
DEVPKEY_Device_DeviceDesc                      Red Hat VirtIO Ethernet Adapter
DEVPKEY_Device_HardwareIds                     {PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00, PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4, PCI\VEN_1AF4&DEV_1000&CC_020000, PCI\VEN_1AF4&DEV_1000&CC_0200}
DEVPKEY_Device_CompatibleIds                   {PCI\VEN_1AF4&DEV_1000&REV_00, PCI\VEN_1AF4&DEV_1000, PCI\VEN_1AF4&CC_020000, PCI\VEN_1AF4&CC_0200...}
DEVPKEY_Device_Service                         netkvm
DEVPKEY_Device_Class                           Net
DEVPKEY_Device_ClassGuid                       {4D36E972-E325-11CE-BFC1-08002BE10318}
DEVPKEY_Device_Driver                          {4d36e972-e325-11ce-bfc1-08002be10318}\0006
DEVPKEY_Device_ConfigFlags                     0
DEVPKEY_Device_Manufacturer                    Red Hat, Inc.
DEVPKEY_Device_FriendlyName                    Red Hat VirtIO Ethernet Adapter #6
DEVPKEY_Device_LocationInfo                    PCI bus 0, device 17, function 0
DEVPKEY_Device_PDOName                         \Device\NTPNP_PCI0011
DEVPKEY_Device_Capabilities                    0
DEVPKEY_Device_BusTypeGuid                     {C8EBDFB0-B510-11D0-80E5-00A0C92542E3}
DEVPKEY_Device_LegacyBusType                   5
DEVPKEY_Device_BusNumber                       0
DEVPKEY_Device_EnumeratorName                  PCI
DEVPKEY_Device_Address                         1114112
DEVPKEY_Device_PowerData                       {56, 0, 0, 0...}
DEVPKEY_Device_RemovalPolicy                   1
DEVPKEY_Device_RemovalPolicyDefault            1
DEVPKEY_Device_InstallState                    0
DEVPKEY_Device_BaseContainerId                 {00000000-0000-0000-FFFF-FFFFFFFFFFFF}
DEVPKEY_NAME                                   Red Hat VirtIO Ethernet Adapter #6
DEVPKEY_Device_InstanceId                      PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&88
DEVPKEY_Device_DevNodeStatus                   25174026
DEVPKEY_Device_ProblemCode                     0
DEVPKEY_Device_Parent                          ACPI\PNP0A03\0
DEVPKEY_Device_Siblings                        {PCI\VEN_8086&DEV_1237&SUBSYS_00000000&REV_02\3&267a616a&0&00, PCI\VEN_8086&DEV_7000&SUBSYS_00000000&REV_00\3&267a616a&0&08, PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00\3&267a616a&0&10, PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267a616a&0&18...}
DEVPKEY_Device_SafeRemovalRequired             False
DEVPKEY_Device_ContainerId                     {00000000-0000-0000-FFFF-FFFFFFFFFFFF}
DEVPKEY_Device_IsPresent                       True
DEVPKEY_Device_HasProblem                      False
{83DA6326-97A6-4088-9453-A1923F573B29} 15      True
DEVPKEY_Device_IsRebootRequired                False
DEVPKEY_Device_ReportedDeviceIdsHash           1342956424
DEVPKEY_Device_InLocalMachineContainer         True
DEVPKEY_Device_Stack                           {\Driver\netkvm, \Driver\pci}
{A8B865DD-2E3D-4094-AD97-E593A70C75D6} 26      False
{3464F7A4-2444-40B1-980A-E0903CB6D912} 10      2
DEVPKEY_PciDevice_DeviceType                   0
DEVPKEY_PciDevice_CurrentSpeedAndMode          0
DEVPKEY_PciDevice_BaseClass                    2
DEVPKEY_PciDevice_SubClass                     0
DEVPKEY_PciDevice_ProgIf                       0
DEVPKEY_PciDevice_InterruptSupport             1
DEVPKEY_PciDevice_BarTypes                     1
DEVPKEY_PciDevice_S0WakeupSupported            True
DEVPKEY_PciDevice_RequiresReservedMemoryRegion False
DEVPKEY_Device_BusReportedDeviceDesc           Ethernet Controller
DEVPKEY_Device_ConfigurationId                 oem2.inf:PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00,kvmnet6.ndi
{80497100-8C73-48B9-AAD9-CE387E19C56E} 6       6
{83DA6326-97A6-4088-9453-A1923F573B29} 3       oem2.inf:664f42767dbc5606:kvmnet6.ndi:100.74.104.14100:PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00
{83DA6326-97A6-4088-9453-A1923F573B29} 10      ACPI\PNP0A03\0
{83DA6326-97A6-4088-9453-A1923F573B29} 18      0
DEVPKEY_Device_InstallDate                     20190404180902.239000-420
DEVPKEY_Device_FirstInstallDate                20190404174841.372159-420
DEVPKEY_Device_LastArrivalDate                 20190416120950.133039-420
DEVPKEY_Device_LocationPaths                   {PCIROOT(0)#PCI(1100), ACPI(_SB_)#ACPI(PCI0)#PCI(1100)}
DEVPKEY_Device_DriverDate                      20170718170000.000000-420
DEVPKEY_Device_DriverVersion                   100.74.104.14100
DEVPKEY_Device_DriverDesc                      Red Hat VirtIO Ethernet Adapter
DEVPKEY_Device_DriverInfPath                   oem2.inf
DEVPKEY_Device_DriverInfSection                kvmnet6.ndi
DEVPKEY_Device_MatchingDeviceId                PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00
DEVPKEY_Device_DriverProvider                  Red Hat, Inc.
DEVPKEY_Device_DriverRank                      16711680
{F0E20F09-D97A-49A9-8046-BB6E22E6BB2E} 2       {1, 0, 0, 0...}

Device number and function number can be found in DEVPKEY_Device_LocationInfo and DEVPKEY_Device_Address:

PS C:\Users\Administrator> (gwmi Win32_Bus -Filter 'DeviceID like "PCI%"').GetRelated('Win32_PnPEntity').GetDeviceProperties('DEVPKEY_Device_Address').deviceProperties | ft DeviceID,keyName,{$_.data -shr 16},{$_.data -band 0xFFFF}

DeviceID                                                     keyName                $_.data -shr 16 $_.data -band 0xFFFF
--------                                                     -------                --------------- --------------------
PCI\VEN_8086&DEV_7000&SUBSYS_00000000&REV_00\3&267A616A&0&08 DEVPKEY_Device_Address               1                    0
PCI\VEN_80EE&DEV_CAFE&SUBSYS_00000000&REV_00\3&267A616A&0&20 DEVPKEY_Device_Address               4                    0
PCI\VEN_8086&DEV_2829&SUBSYS_00000000&REV_02\3&267A616A&0&68 DEVPKEY_Device_Address              13                    0
PCI\VEN_8086&DEV_1237&SUBSYS_00000000&REV_02\3&267A616A&0&00 DEVPKEY_Device_Address               0                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&18 DEVPKEY_Device_Address               3                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&40 DEVPKEY_Device_Address               8                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&48 DEVPKEY_Device_Address               9                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&50 DEVPKEY_Device_Address              10                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&80 DEVPKEY_Device_Address              16                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&88 DEVPKEY_Device_Address              17                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&90 DEVPKEY_Device_Address              18                    0
PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00\3&267A616A&0&98 DEVPKEY_Device_Address              19                    0
PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000&REV_00\3&267A616A&0&10 DEVPKEY_Device_Address               2                    0
0

It sounds like you need something like lspci, but for Windows.  If so, look at "SMI" and the other answers to Windows equivalent for lspci?

4
  • saw the answers suggesting 3rd party solutions before, trying to figure out if it's doable without. thanks anyway :)
    – marekp
    Aug 12, 2015 at 11:17
  • Just wait until you reach 50 rep to comment. Don't post comments as answers to get around that.
    – Jamal
    Aug 12, 2015 at 14:43
  • @Jamal : okay will wait.
    – ART
    Aug 12, 2015 at 16:03
  • @GeorgeSovetov Thanks for fixing the broken link, but, when you edit a post, please improve all the things that need to be improved. Apr 17, 2019 at 15:20
-2

You can also try this:

  1. Open Device Manager. (You can do this by typing devmgmt.msc on run).
  2. Click on Network Adapters.
  3. Choose the adapter you want to debug. (If there is only one, obviously you'll not have any choice).
  4. Right click on your chosen adapter, and click on Properties.
  5. Click on Details tab.
  6. In the property dropdown box, select Location Information. This will show you the value of Bus Number, Device Number, and Function Number all at one place.
1
  • Everyone else already answered for Windows because the question was about a Windows computer to begin with. Aug 14, 2020 at 1:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .