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():
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.