ULONG
HalGetBusData(
IN BUS_DATA_TYPE BusDataType,
IN ULONG BusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Length
);
HalGetBusData obtains details about a given slot or address on a particular I/O bus.
If Cmos is specified, the buffer will contain the contents of the CMOS (bus number equals zero) or ECMOS (bus number equals one) locations starting with the location specified for SlotNumber.
If EisaConfiguration is specified, the buffer will contain the CM_EISA_SLOT_INFORMATION structure followed by zero or more CM_EISA_FUNCTION_INFORMATION structures for the specified slot.
If Pos is specified, the buffer will contain a CM_MCA_POS_DATA structure for the specified slot.
If PCIConfiguration is specified, the buffer will contain the
PCI_COMMON_CONFIG information for the given SlotNumber.
HalGetBusData returns the number of bytes of data it wrote in the given buffer. If the given BusDataType is not valid for the current platform, this routine returns zero.
When the input BusType is PCIConfiguration, HalGetBusData can return either of the following values to indicate an error:
Value |
Meaning |
0 (zero) |
The specified PCI bus does not exist. |
2 |
The specified PCI bus exists, but there is no device at the given PCI SlotNumber. The Buffer also contains the value PCI_INVALID_VENDOR_ID at the PCI_COMMON_CONFIG VendorId member. |
Device drivers call this routine during initialization to locate their devices on a particular I/O bus in the machine. The bus-type-specific configuration data returned is later used in calls to other configuration and initialization routines, such as HalTranslateBusAddress, HalGetInterrupt, HalGetAdapter, IoAssignResources, and so forth.
Calling HalGetBusData with any BusDataType except Cmos is the same as calling HalGetBusDataByOffset with an input Offset of zero.
If the input BusDataType is PCIConfiguration, callers of HalGetBusData can be running at IRQL <= DISPATCH_LEVEL. Otherwise, callers of HalGetBusData must be running at IRQL PASSIVE_LEVEL.
CM_EISA_FUNCTION_INFORMATION, CM_EISA_SLOT_INFORMATION, CM_MCA_POS_DATA, HalAssignSlotResources, HalGetAdapter, HalGetBusDataByOffset, HalGetInterruptVector, HalSetBusData, HalTranslateBusAddress, IoAssignResources, PCI_COMMON_CONFIG, PCI_SLOT_NUMBER