KsDeviceGetBusData function

The KsDeviceGetBusData function reads data from the bus where the given AVStream device resides.


ULONG KsDeviceGetBusData(
  _In_ PKSDEVICE Device,
  _In_ ULONG     DataType,
  _In_ PVOID     Buffer,
  _In_ ULONG     Offset,
  _In_ ULONG     Length



A pointer to the KSDEVICE structure representing the given AVStream device for which data from the bus should be read.


This parameter indicates the type of bus data to be read. Zero corresponds to configuration space. For further information, see the discussion of WhichSpace in the reference page for IRP_MN_READ_CONFIG.


A pointer to a buffer that receives the data read from the bus. Must be at least as large as Length.


This parameter contains the byte offset in the space specified by DataType from which data is read.


This parameter specifies the number of bytes to read into Buffer.

Return Value

KsDeviceGetBusData returns the number of bytes actually read from the bus. If an errors occurs, this value is zero.


Depending on the driver for the bus where the specified device resides, there are two possible behaviors and restriction sets on this function. If the given bus driver supports the bus interface standard (usually PCI), call this function at either IRQL = PASSIVE_LEVEL or DISPATCH_LEVEL. After such a call, KsDeviceGetBusData returns the actual number of bytes read from the requested space. If, however, the given bus driver does not support the bus interface standard, then AVStream communicates with the bus driver through IoCallDriver. Note that this restricts use of KsDeviceGetBusData to IRQL = PASSIVE_LEVEL and also means that the return value is either 0, in the case of failure, or equal to Length if data acquisition was successful.

To ensure compatibility, minidriver writers may want to restrict use of KsDeviceGetBusData to IRQL = PASSIVE_LEVEL.


Windows version Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.
Target Platform Universal
Header ks.h (include Ks.h)
Library Ks.lib
IRQL PASSIVE_LEVEL (See Remarks section)

See Also



Send comments about this topic to Microsoft