Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

IoGetDeviceAttachmentBaseRef routine

The IoGetDeviceAttachmentBaseRef routine returns a pointer to the lowest-level device object in a file system or device driver stack.

Syntax


PDEVICE_OBJECT IoGetDeviceAttachmentBaseRef(
  _In_  PDEVICE_OBJECT DeviceObject
);

Parameters

DeviceObject [in]

A pointer to a device object in the stack.

Return value

IoGetDeviceAttachmentBaseRef returns a pointer to the device object at the bottom of the file system or device driver stack. If the given device object is not attached to a driver stack, IoGetDeviceAttachmentBaseRef returns the device object pointer in DeviceObject.

Remarks

A file system filter driver typically calls IoGetDeviceAttachmentBaseRef to get the lowest-level device object in a file system driver stack. Often this is done when the filter driver receives notification that a file system has registered or unregistered itself as an active file system. The filter driver's notification callback routine calls IoGetDeviceAttachmentBaseRef to get a pointer to the file system's control device object, and then calls ObQueryNameString to retrieve this object's name for debugging purposes.

IoGetDeviceAttachmentBaseRef increments the reference count on the device object at the bottom of the stack. Thus every successful call to IoGetDeviceAttachmentBaseRef must be matched by a subsequent call to 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

IoEnumerateDeviceObjectList
IoGetLowerDeviceObject
IoRegisterFsRegistrationChange
IoUnregisterFsRegistrationChange
ObDereferenceObject
ObQueryNameString

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.