VideoPortGetBusData

ULONG VideoPortGetBusData(

    PVOID  HwDeviceExtension,

    BUS_DATA_TYPE  BusDataType,

    ULONG  SlotNumber,

    PVOID  Buffer,

    ULONG Offset,

    ULONG Length

   );

VideoPortGetBusData returns bus-type-specific configuration information.

Parameters

HwDeviceExtension
Points to the miniport driver’s device extension.
BusDataType
Specifies the type of bus configuration data to return. Currently, the value of this parameter can be one of the following:

Cmos
EisaConfiguration
Pos
PCIConfiguration

However, additional types of bus configuration will be supported in the future. The upper bound on the types supported is always MaximumBusDataType.

SlotNumber
Specifies the logical slot number or, for a Cmos BusDataType, the location of the device on the bus.

If PCIConfiguration is specified as the BusDataType, this parameter must be specified as a PCI_SLOT_NUMBER-type value.

Buffer
Points to a buffer into which VideoPortGetBusData returns the configuration information. The contents of the buffer depend on the BusDataType, as follows:
  • If Cmos is specified, the buffer contains the contents of the CMOS (bus number equals zero) or ECMOS (bus number equals one) locations, starting with the location specified for SlotNumber. A miniport’s HwVidFindAdapter function can determine the number of the bus from the SystemIoBusNumber member of the VIDEO_PORT_CONFIG_INFO input structure.

  • If EisaConfiguration is specified, the buffer contains 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 contains a CM_MCA_POS_DATA structure for the specified slot.

  • If PCIConfiguration is specified, the buffer contains the PCI_COMMON_CONFIG information for the specified slot.
Offset
Zero for all BusInterfaceType values except PCIConfiguration. Otherwise, this specifies the starting offset within the PCI_COMMON_CONFIG structure from which the requested information should be returned. Callers can use PCI_COMMON_HDR_LENGTH to specify the device-specific area of PCI_COMMON_CONFIG.
Length
Specifies the maximum number of bytes to return in Buffer.

Return Value

VideoPortGetBusData returns the number of bytes of configuration information it has written in Buffer. If the given BusDataType is not valid for the current platform, this function usually returns zero.

When the BusDataType parameter is PCIConfiguration, VideoPortGetBusData can return either of the following values to indicate an error:

Value

Meaning

0

The PCI bus does not exist.

2

The PCI bus exists, but there is no device at the given PCI SlotNumber. The Buffer contains the value PCI_INVALID_VENDOR_ID at the PCI_COMMON_CONFIG VendorId member.

Comments

VideoPortGetBusData can be called only from a miniport’s HwVidFindAdapter function.

Drivers of PCI video adapters usually call VideoPortGetAccessRanges rather than VideoPortGetBusData.

See Also

CM_EISA_FUNCTION_INFORMATION, CM_EISA_SLOT_INFORMATION, CM_MCA_POS_DATA, HwVidFindAdapter, HwVidQueryDeviceCallback, PCI_COMMON_CONFIG, PCI_SLOT_NUMBER, VIDEO_PORT_CONFIG_INFO, VideoPortGetAccessRanges, VideoPortGetDeviceBase, VideoPortGetDeviceData, VideoPortGetRegistryParameters