IoGetLowerDeviceObject - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntifs.h

PDEVICE_OBJECT IoGetLowerDeviceObject(
  [in] PDEVICE_OBJECT DeviceObject
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-iogetlowerdeviceobject)

IoGetLowerDeviceObject function

Description

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

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:

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 if there is one. Thus every call to IoGetLowerDeviceObject that doesn't return NULL must be matched by a subsequent call ObDereferenceObject.

See also

IoGetAttachedDevice

IoGetAttachedDeviceReference

ObDereferenceObject