// ks.h
KSDDKAPI NTSTATUS KsReferenceBusObject(
[in] KSDEVICE_HEADER Header
);
View the official Windows Driver Kit DDI referenceNo description available.
References the bus Physical device object.
Header [in]Points to a header previously allocated by KsAllocateDeviceHeader that also contains the PnP device stack object.
Returns STATUS_SUCCESS if the reference was successful, else an error such as STATUS_INSUFFICIENT_RESOURCES.
This function is used by filters that use the device header to keep track of their PnP object stack. This is normally called on a successful Open of the filter when the bus for this device requires such a reference (such as software devices), and is matched by a call to KsDereferenceBusObject on a close of that filter instance. The caller must have previously also called KsSetDevicePnpAndBaseObject in order to set the PnP device stack object. This would have been done in the PnP AddDevice function. If the object has not been previously referenced, interface space is allocated and the function uses the PnP device object to acquire the bus referencing interface. It then calls the ReferenceDeviceObject method on that interface. The interface itself is released and freed when the device header is freed.