반응형

FileSystem Devive Object Storage Device Object 얻기


MSDN에는 windows 2000 sp4 이상 지원하는 것으로 명기되어 있지만, 실제 확인해 보니 windows 2000 professional sp4에서는 지원하지 않는다.



IoGetDiskDeviceObject

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

NTSTATUS
  IoGetDiskDeviceObject(
    IN PDEVICE_OBJECT  FileSystemDeviceObject,
    OUT PDEVICE_OBJECT  *DeviceObject
    ); 

Parameters

FileSystemDeviceObject
Pointer to the file system device object.
DeviceObject
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:

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

Comments

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.

Requirements

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

IRQL: <=DISPATCH_LEVEL

Headers: Declared in ntifs.h. Include ntifs.h.

반응형

+ Recent posts