PURPOSE
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.
PROTOTYPE
DWORD WD_PciScanCards(
HANDLE hWD,
WD_PCI_SCAN_CARDS *pPciScan);
PARAMETERS
| Name | Type | Input/Output |
|---|---|---|
| HANDLE | Input | |
| WD_PCI_SCAN_CARDS* | ||
| WD_PCI_ID | ||
| DWORD | Input | |
| DWORD | Input | |
| DWORD | Output | |
| WD_PCI_ID[WD_PCI_CARDS] | ||
| DWORD | Output | |
| DWORD | Output | |
| WD_PCI_SLOT[WD_PCI_CARDS] | ||
| DWORD | Output | |
| DWORD | Output | |
| DWORD | Output | |
| DWORD | Input |
DESCRIPTION
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2] |
| pPciScan | Pointer to a PCI bus scan information structure: |
| PCI card ID information structure: | |
| The vendor ID of the PCI cards to detect. If 0, the function will search for all PCI card vendor IDs. | |
| 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. |
|
| Number of cards detected for the specified search criteria set in the searchId field | |
| Array of PCI card ID information structures for the detected PCI cards that match the search criteria set in the searchId field: | |
| Vendor ID | |
| Card ID | |
| Array of PCI slot information structures for the detected PCI cards that match the search criteria set in the searchId field: | |
| Bus number (0 based) | |
| Slot number (0 based) | |
| Function number (0 based) | |
| PCI bus scan options. Can be either of the following:
This is the default scan option. |
RETURN VALUE
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].
EXAMPLE
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");