Share via


HalSetBusDataByOffset (Windows CE 5.0)

Send Feedback

This function sets bus-configuration data for a device on a dynamically configurable I/O bus with a published, standard interface.

ULONG HalSetBusDataByOffset(BUS_DATA_TYPEBusDataType,ULONG BusNumber,ULONG SlotNumber,PVOIDBuffer,ULONG Offset,ULONG Length );

Parameters

  • BusDataType
    [in] Bus data to set. This value can be PCIConfiguration. The upper bound on the types supported is always MaximumBusDataType.

  • BusNumber
    [in] Zero-based and system-assigned number of the bus in systems with several buses of the same BusDataType.

  • SlotNumber
    [in] Logical slot number or location of the device. If you specify PCIConfiguration as the BusDataType, this value is specified as a PCI_SLOT_NUMBER value, which is the slot and function numbers combined.

  • Buffer
    [in] Pointer to a caller-supplied buffer for configuration information specific to BusDataType.

    If you specify PCIConfiguration, the buffer contains the PCI_COMMON_CONFIG information for the specified SlotNumber and function number. The specified Offset and Length determine how much information to supply. Certain members of PCI_COMMON_CONFIG have read-only values. The caller is responsible for preserving the system-supplied values of read-only members.

  • Offset
    [in] Byte offset in the PCI_COMMON_CONFIG structure where the caller-supplied configuration values begin. Callers can use the system-defined constant PCI_COMMON_HDR_LENGTH to specify the device-specific area of PCI_COMMON_CONFIG.

  • Length
    [in] Number of bytes in Buffer.

Return Values

Returns the number of bytes of data successfully set for the specified SlotNumber. If the specified BusDataType is not valid for the current platform or if the supplied information is invalid, this function returns 0.

Remarks

A driver can call this function or HalSetBusData if unusual circumstances or the nature of its device requires such a call. For example, a driver might call either of these functions to clear a bit in the PCI status register if its device signals a target abort during initialization. Usually, the hardware or startup code configures the device appropriately.

When accessing the device-specific area of the PCI configuration space, HalSetBusDataByOffset guarantees that this function never reads or writes data outside the range specified by the input Offset and Length and even if the input Length is exactly a byte or a two-byte word, this function never accesses any data outside the requested range.

Requirements

OS Versions: Windows CE 2.10 and later.
Header: CEDDK.h.
Link Library: CEDDK.lib.

See Also

BUS_DATA_TYPE | HalGetBusData | HalGetBusDataByOffset | HalSetBusData | HalTranslateBusAddress | PCI_COMMON_CONFIG

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.