Monty wrote:
> i wanted to read the MFT of individual drives, i had some
> sample code that does it without logical drive names but now it
> seems the correct way is to iterate all the drive names through
> GetLogicalDriveNames and the read through QueryDosDevice and
> read the MFT
That depends on what you want to do. If you know you want to
read the MFT for C: then use QueryDosDevice() to translate "C:"
into a logical volume name. (no iteration is needed). Once you
have the logical volume name you open it with CreateFile() and
then pass the handle to DeviceIoControl() with
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS to get the list of physical
device numbers. You can then convert the physical device numbers
into physical device names and your existing sample code should
work for reading the MFT if there's just one physical device and
I have no idea if your code supports spanned volumes.
I'd just write the code and show you but don't have time at the moment.
> Also is there any other way except the use of
> IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
I don't know off hand but Google for
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS registry
seems to find interesting stuff and a quick look with regedit finds
HKEY_LOCAL_MACHINE \ SYSTEM \ MountedDevices
Those look like Unicode strings and I suspect you can bypass at
least the call to QueryDosDevice() with this.
Marc
>> Stay informed about: Logical Drive Name