HalSetBusData

ULONG
    HalSetBusData(

        IN BUS_DATA_TYPE  BusDataType,
        IN ULONG  BusNumber,
        IN ULONG  SlotNumber,
        IN PVOID  Buffer,
        IN ULONG  Length
        );

HalSetBusData sets bus-configuration data for a given slot or address on a particular bus.

Parameters

BusDataType
Specifies the type of bus data to be set. Currently, its value can be the following: Cmos or PCIConfiguration. However, additional types of bus configuration will be supported in future versions of Windows NT. The upper bound on the bus types supported is always MaximumBusDataType.
BusNumber
Specifies the zero-based and system-assigned number of the bus in systems with more than one bus of the same BusDataType.
SlotNumber
Specifes the logical slot number for the device. When PCIConfiguration is specified, this is a PCI_SLOT_NUMBER-type value.
Buffer
Points to a caller-supplied buffer containing information specific to BusDataType.

When Cmos is specified, the buffer contains data to be written to CMOS (BusNumber equals zero) or ECMOS (BusNumber equals one) locations starting with the location specified by the SlotNumber.

When PCIConfiguration is specified, the buffer contains some or all of the PCI_COMMON_CONFIG information for the given SlotNumber. The specified Length determines how much information is supplied. Certain members of PCI_COMMON_CONFIG have read-only values, and the caller is responsible for preserving the system-supplied values of read-only members.

Length
Specifies the number of bytes of configuration data in Buffer.

Return Value

HalSetBusData returns the number of bytes of data successfully set for the given SlotNumber. If the given BusDataType is not valid for the current platform or if the supplied information is invalid, this routine returns zero.

Comments

Calling HalSetBusDataByOffset with a BusDataType of PCIConfiguration and an input Offset of zero is the same as calling HalSetBusData.

If the input BusDataType is PCIConfiguration, callers of HalSetBusData can be running at IRQL <= DISPATCH_LEVEL. Otherwise, callers of HalSetBusData must be running at IRQL PASSIVE_LEVEL.

See Also

HalGetBusData, HalGetBusDataByOffset, HalSetBusDataByOffset, PCI_COMMON_CONFIG, PCI_SLOT_NUMBER