Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

KsSetTargetDeviceObject function

The KsSetTargetDeviceObject function sets the target device object of an object. The function adds the object header to a list of object headers that have target devices.

Syntax


VOID KsSetTargetDeviceObject(
  _In_     KSOBJECT_HEADER Header,
  _In_opt_ PDEVICE_OBJECT  TargetDevice
);

Parameters

Header [in]

Points to a header previously allocated by KsAllocateObjectHeader.

TargetDevice [in, optional]

Optionally contains the target device object that will be used when recalculating the stack depth for the underlying device object. If the value is NULL, any current setting is removed. If the value is any setting other than NULL, the current setting is replaced.

Return value

None

Remarks

The KsSetTargetDeviceObject function assumes that the caller has previously allocated a device header on the underlying device object with the KsAllocateDeviceHeader function. The presence of the device header allows future calls to the function KsRecalculateStackDepth, and the device header is used when the object will be forwarding IRPs through a connection to another device and needs to keep track of the stack depth.

If KsSetDevicePnpAndBaseObject is also used to assign the PnP object stack, that device object will also be taken into account when recalculating stack depth.

Requirements

Target platform

Universal

Header

Ks.h (include Ks.h)

Library

Ks.lib

See also

KsSetDevicePnpAndBaseObject
KsRecalculateStackDepth
KsAllocateDeviceHeader
KsAllocateObjectHeader

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft