Hardware Dev Center

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

IoGetAttachedDevice routine

The IoGetAttachedDevice routine returns a pointer to the highest-level device object associated with the specified device.

Syntax


PDEVICE_OBJECT IoGetAttachedDevice(
  _In_ PDEVICE_OBJECT DeviceObject
);

Parameters

DeviceObject [in]

A pointer to the device object for which the topmost attached device is to be returned.

Return value

IoGetAttachedDevice returns the highest-level device attached to the specified device.

Remarks

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.

Requirements

Target platform

Universal

Header

Ntifs.h (include Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

<= DISPATCH_LEVEL

See also

IoGetAttachedDeviceReference
ObDereferenceObject

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft