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: - \Device\HarddiskVolume1
D: - \Device\HarddiskVolume2
E: - \Device\HarddiskDmVolumes\MybondDg0\Volume1
F: - \Device\HarddiskDmVolumes\MybondDg0\Volume2
(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: - \Device\HarddiskVolume1
D: - \Device\HarddiskVolume2
E: - \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1
F: - \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume2
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:
\Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1
not
\Device\HarddiskDmVolumes\MybondDg0\Volume1?
Thank you so much!
--
Regards
Mike