How to get the physical device name of a dynamic disk volume

Home Forums Discussions General How to get the physical device name of a dynamic disk volume

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5255
    Winsor
    Participant

      Hi guys,

      As we know, the Windows API QueryDosDevice() can get the physical device name of a partition or volume in a basic disk. But it doesn’t work if the volume is a dynamic volume in a dynamic disk.(Actually, the API will return a fake name). For example, there are 2 disks in my computer, one is a basic disk and another is a dynamic disk. The basic disk has 2 volumes, with drive letter C: and D: and the dynamic disk also has 2 volumes (dynamic volumes), with drive letter E: and F: .

      Get the physical device names of those volumes by API QueryDosDevice():

      C: – DeviceHarddiskVolume1
      D: – DeviceHarddiskVolume2
      E: – DeviceHarddiskDmVolumesMybondDg0Volume1
      F: – DeviceHarddiskDmVolumesMybondDg0Volume2

      (Note: the string “mybond” is the specified personal name when I installed the OS, which is Windows 2000 Professional with SP4).

      Then, I use a filter driver, which is built on sfilter in Windows IFS Kit, to catch the IRP_MJ_CREATE IRPs when accessing those volumes, and get those volumes’s physical device names like following:

      C: – DeviceHarddiskVolume1
      D: – DeviceHarddiskVolume2
      E: – DeviceHarddiskDmVolumesPhysicalDmVolumesBlockVolume1
      F: – DeviceHarddiskDmVolumesPhysicalDmVolumesBlockVolume2

      Comparing the above two different names, we can find out that QueryDosDevice() couldn’t get the true physical device name of a dynamic volume. So, how can I get the true name like:

      DeviceHarddiskDmVolumesPhysicalDmVolumesBlockVolume1

      not

      DeviceHarddiskDmVolumesMybondDg0Volume1?

      Thanks!

      #6757
      jludwig
      Participant

        DeviceHarddiskDmVolumesMybondDg0Volume2 is a symbolic link to DeviceHarddiskDmVolumesPhysicalDmVolumesBlockVolume2 . When I write code to find the device name, I call QueryDosDevice iteratively until it fails (assuming it succeeded at least once). That way if a symbolic link points to another, you’ll find the actual kernel name.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.