Detects PCI devices installed on the PCI bus, which conform to the input criteria (vendor ID and/or card ID), and returns the number and location (bus, slot and function) of the detected devices.
DWORD WD_PciScanCards(
HANDLE hWD,
WD_PCI_SCAN_CARDS *pPciScan);
| Name | Type | Input/Output |
|---|---|---|
| hWD | HANDLE | Input |
| pPciScan | WD_PCI_SCAN_CARDS* | |
| • searchId | WD_PCI_ID | |
| * dwVendorId | DWORD | Input |
| * dwDeviceId | DWORD | Input |
| • dwCards | DWORD | Output |
| • cardId | WD_PCI_ID[WD_PCI_CARDS] | |
| * dwVendorId | DWORD | Output |
| * dwDeviceId | DWORD | Output |
| • cardSlot | WD_PCI_SLOT[WD_PCI_CARDS] | |
| * dwBus | DWORD | Output |
| * dwSlot | DWORD | Output |
| * dwFunction | DWORD | Output |
| • dwOptions | DWORD | Input |
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as
received from WD_Open() |
| pPciScan | Pointer to a PCI bus scan information structure: |
| • searchId | PCI card ID information structure: |
| * dwVendorId | The vendor ID of the PCI cards to detect. If 0, the function will search for all PCI card vendor IDs. |
| * dwDeviceId |
The card ID of the PCI cards to detect. If 0, the function will search for
all PCI card IDs. If both dwVendorId and dwDeviceId are set to
0 the function will return information regarding all connected PCI cards.
|
| • dwCards |
Number of cards detected for the specified search criteria set in the
searchId field
|
| • cardId |
Array of PCI card ID information structures for the detected PCI cards that
match the search criteria set in the searchId field:
|
| * dId.dwVendorId | Vendor ID |
| * dId.dwDeviceId | Card ID |
| • cardSlot |
Array of PCI slot information structures for the detected PCI cards that
match the search criteria set in the searchId field:
|
| * dwBus | Bus number (0 based) |
| * dwSlot | Slot number (0 based) |
| * dwFunction | Function number (0 based) |
| • dwOptions |
PCI bus scan options. Can be set to any of the following flags: • WD_PCI_SCAN_DEFAULT — Scan all PCI buses
and slots.This is the default scan option. • WD_PCI_SCAN_BY_TOPOLOGY — Scan the PCI bus
by topology.
• WD_PCI_SCAN_REGISTERED — Scan all PCI
buses and slots but only look for devices that have been registered to
work with WinDriver.
|
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate
error code otherwise
WD_PCI_SCAN_CARDS pciScan;
DWORD cards_found;
WD_PCI_SLOT pciSlot;
BZERO(pciScan);
pciScan.searchId.dwVendorId = 0x12bc;
pciScan.searchId.dwDeviceId = 0x1;
WD_PciScanCards(hWD, &pciScan);
if (pciScan.dwCards>0) /* Found at least one device */
pciSlot = pciScan.cardSlot[0]; /* Use the first card found */
else
printf("No matching PCI devices found\n");