IoGetDiskDeviceObject - NtDoc

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

NTSTATUS IoGetDiskDeviceObject(
  [in] PDEVICE_OBJECT FileSystemDeviceObject,
       PDEVICE_OBJECT *DiskDeviceObject
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

IoGetDiskDeviceObject function

Description

The IoGetDiskDeviceObject routine retrieves a pointer to the disk device object associated with a given file system volume device object.

Parameters

FileSystemDeviceObject [in]

A pointer to the file system device object.

DiskDeviceObject

A pointer to a variable that receives the address of the device object for the disk device object.

Return value

IoGetDiskDeviceObject returns one of the following status values:

Return code Description
STATUS_INVALID_PARAMETER One of the parameters passed to this function was invalid.
STATUS_VOLUME_DISMOUNTED
STATUS_SUCCESS

Remarks

IoGetDiskDeviceObject returns a pointer to the storage device object associated with the file system volume. The storage device need not be an actual disk

File system filter drivers typically call IoGetDiskDeviceObject for a file system volume device object to determine whether the volume is mounted.

IoGetDiskDeviceObject increments the reference count on the disk device object pointed to by DeviceObject. Thus every successful call to IoGetDiskDeviceObject must be matched by a subsequent call to ObDereferenceObject.

See also

IoEnumerateDeviceObjectList

IoGetAttachedDevice

IoGetAttachedDeviceReference

IoGetLowerDeviceObject

ObDereferenceObject