Bewerken

Delen via


SpbControllerSetTargetAttributes function (spbcx.h)

The SpbControllerSetTargetAttributes method sets object attributes that will be used for all SPBTARGET objects that the SPB framework extension (SpbCx) delivers to the SPB controller driver.

Syntax

void SpbControllerSetTargetAttributes(
  [in] WDFDEVICE              FxDevice,
  [in] PWDF_OBJECT_ATTRIBUTES ObjectAttributes
);

Parameters

[in] FxDevice

A WDFDEVICE handle to the device object that represents the SPB controller.

[in] ObjectAttributes

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that contains attributes for the controller's SPBTARGET objects.

Return value

None

Remarks

Your SPB controller driver calls this method to set the default attributes for SPBTARGET objects. The SPB framework extension (SpbCx) sets these attributes on any target devices on the bus that are opened by clients (peripheral devices) of the controller.

ObjectAttributes points to an WDF_OBJECT_ATTRIBUTES structure. The caller must previously have called the WDF_OBJECT_ATTRIBUTES_INIT function to initialize this structure. After this call, but before the call to SpbControllerSetTargetAttributes, the caller can change the values of the following members of this structure:

  • EvtCleanupCallback
  • EvtDestroyCallback
  • ContextSizeOverride
  • ContextTypeInfo
SpbControllerSetTargetAttributes will use these values as default attributes for SPBTARGET objects. However, the driver cannot change the default attribute values that are contained in the ExecutionLevel, SynchronizationScope, and ParentObject members. These members must remain unchanged from the values that they were initialized to by the WDF_OBJECT_ATTRIBUTES_INIT function.

The SPB controller driver must call this method before it commits the device object—that is, before it returns from the EvtDriverDeviceAdd callback or adds the PDO to the controller's child list. The child list represents the devices that are attached to the bus. For more information, see Enumerating the Devices on a Bus.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header spbcx.h
Library Spbcxstubs.lib
IRQL PASSIVE_LEVEL

See also

EvtDriverDeviceAdd

WDF_OBJECT_ATTRIBUTES

WDF_OBJECT_ATTRIBUTES_INIT