Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

DevicePath -> drive letter

Bob_KroeterBob_Kroeter Member Posts: 65
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?

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Use FindFirstVolume and similar APIs instead.

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

    <xxxxx@gmail.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?
    >
    >
  • Bob_KroeterBob_Kroeter Member Posts: 65
    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?
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    >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
  • Alex_CarpAlex_Carp Member Posts: 1,016
    You could try asking the mountmgr using IOCTL_MOUNTMGR_QUERY_POINTS.

    Thanks,
    Alex.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE