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!