IoGetAttachedDevice function (ntifs.h)
The IoGetAttachedDevice routine returns a pointer to the highest-level device object associated with the specified device.
PDEVICE_OBJECT IoGetAttachedDevice( [in] PDEVICE_OBJECT DeviceObject );
A pointer to the device object for which the topmost attached device is to be returned.
IoGetAttachedDevice returns the highest-level device attached to the specified device.
If the device object specified by DeviceObject has no other device objects attached to it, DeviceObject and the returned pointer are equal.
IoGetAttachedDevice differs from IoGetAttachedDeviceReference in the following respects:
IoGetAttachedDevice does not increment the reference count on the device object. (Thus no matching call to ObDereferenceObject is required.)
Callers of IoGetAttachedDevice must ensure that no device objects are added to or removed from the stack while IoGetAttachedDevice is executing. Callers that cannot do this must use IoGetAttachedDeviceReference instead.
|Header||ntifs.h (include Ntifs.h)|