Export (0) Print
Expand All
Expand Minimize

IoGetLowerDeviceObject routine

The IoGetLowerDeviceObject routine returns a pointer to the next-lower-level device object on the driver stack.

Syntax


PDEVICE_OBJECT IoGetLowerDeviceObject(
  _In_  PDEVICE_OBJECT DeviceObject
);

Parameters

DeviceObject [in]

A pointer to the device object in the stack for which the next-lower-level device object is to be returned.

Return value

IoGetLowerDeviceObject returns a pointer to the next-lower-level device object on the driver stack.

Remarks

Given a pointer to a device object in a file system or device driver stack, IoGetLowerDeviceObject returns a pointer to the next-lower-level device object on the stack.

IoGetLowerDeviceObject returns NULL if:

  • The next-lower-level driver is not loaded.

  • The next-lower-level driver is currently being unloaded, removed, or deleted.

  • The device object pointed to by DeviceObject is the lowest device object in the driver stack.

A file system filter driver typically uses IoGetLowerDeviceObject to determine whether it is already attached to the filter driver stack that is chained above a given file system device object. First, the filter calls IoGetAttachedDeviceReference to get a pointer to the topmost device object in the stack. Then it calls IoGetLowerDeviceObject repeatedly to walk the driver stack, checking each device object to see whether the object belongs to the filter driver.

IoGetLowerDeviceObject increments the reference count on the next-lower-level device object. Thus every successful call to IoGetLowerDeviceObject must be matched by a subsequent call ObDereferenceObject.

Requirements

Version

This routine is available on Update Rollup for Windows 2000 Service Pack 4 (SP4) and on Windows XP and later.

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

IoGetAttachedDevice
IoGetAttachedDeviceReference
ObDereferenceObject

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft