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
);
- 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.
Parameters
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.
'Windows Programming > 드라이버' 카테고리의 다른 글
FsRtlRegisterFileSystemFilterCallbacks() - FileMap을 이용한 파일엑세스 모니터링 (1) | 2009.05.15 |
---|---|
RtlVolumeDeviceToDosName() - 마운트된 디스크의 드라이브 문자 구하기 (0) | 2009.05.15 |
Windows2000에서 구동되는 파일시스템 필터 드라이버 작성시 주의할것 (0) | 2009.04.23 |
파일 시스템 필터 드라이버 등록하기 #2 - Pagefile.sys (0) | 2009.04.23 |
파일 시스템 필터 드라이버 등록하기 #1 - Device Naming (0) | 2009.04.23 |