DevicePath -> drive letter

Given a device interface path retrieved from SetupDiGetDeviceInterfaceDetail for a disk volume I would like to use FSCTL_DISMOUNT_VOLUME. But this fsctl requires CreateFile use a filename in \.\X: form. So is there a way to get the corresponding drive letter from a DevicePath or some other way to achieve this?

Use FindFirstVolume and similar APIs instead.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntfsd…
> Given a device interface path retrieved from SetupDiGetDeviceInterfaceDetail for a disk volume I would like to use FSCTL_DISMOUNT_VOLUME. But this fsctl requires CreateFile use a filename in \.\X: form. So is there a way to get the corresponding drive letter from a DevicePath or some other way to achieve this?
>
>

There are benefits in this product to working off the set of volumes from the setup api’s compared to changing over to FindFirstVolume so this is not a comfortable change. Can you think of a way to make the requested mapping?

>changing over to FindFirstVolume so this is not a comfortable change. Can you think of a way to

make the requested mapping?

IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS and compare them.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

You could try asking the mountmgr using IOCTL_MOUNTMGR_QUERY_POINTS.

Thanks,
Alex.