Get PCIe slot on Windows7

Is there an API available on Win7 which can return me reliable PCIe slot number & attached card details.
2 answers Last reply
More about pcie slot windows7
  1. Sure, lots of programs use it, GPUZ hooks into it, so does device manager. Now what you use to expose it will differ, take a web search trip for some programming guides.
  2. Use the WMI API extensions from within Visual Studio.

    This examples gives you drive information.

    Dim oWMI as SWBEMObjectSet
    Set oWMI =
    Set oWMI = GetObject("winmgmts:impersonationLevel=impersonate}").ExecQuery("select * from Win32_LogicalDisk where DriveType=3")
    Dim wmiObject As SwbemObject
    For Each wmiObject In oWMI
    DriveName = wmiObject.Caption
    FreeSpace = wmiObject.FreeSpace
    TotalSize = wmiObject.Size

    While this code checks to see if the name dnetwork card is using a static I.P or DHCP.

    ipAddress = Array("")
    subnetMask = Array("")
    for each wmiObject in GetObject("winmgmts:").ExecQuery("select * from Win32_NetworkAdapterConfiguration where description='EL90Xbc0 3Com EtherLink PCI'")
    if wmiObject.DHCPEnabled = True then
                  RetVal = Network.EnableStatic(ipAddress, subnetMask)
    if RetVal = 0 then
                  MsgBox "DHCP disabled, using static IP address"
                  MsgBox "DHCP disable failed"
    end if
                  RetVal = wmiObject.EnableDHCP()
                  if RetVal = 0 then
                         MsgBox "DHCP enabled, using dynamic IP address"
                         MsgBox "DHCP enable failed"
                  end if
    end if
Ask a new question

Read More

Configuration Windows 7 API