Physical disk. What is the logical disk?

Source: Internet
Author: User
First, specify the guid and use setupdigetclassdevs to obtain information about all devices in the harddisk and volume categories.
Define_guid/
(Harddisk_guid, 0x53f56307, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b );
Define_guid/
Volume_guid, 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b );

Hdevinfoset = setupdigetclassdevsw (lpguid, null, null, digcf_present | digcf_interfacedevice );

Then, setupdienumdeviceinterfaces is used to enumerate the interface information of each device in the device information set.
If the call succeeds, call setupdigetdeviceinterfacedetail to obtain the details of each device.
Then, use cm_get_parent and cm_get_device_id to obtain the device instance id of the device instance, which is a string similar to the following: pciide/idechannel/4 & e3ec092 & 0 & 0, USB/vid_0d7d & pid_0150/4d3b424303c0.
You must have noticed that all USB devices start with USB and contain both the PID and vid of the device. In this way, you can determine whether the device is from a specific manufacturer. Next, we need to get the drive letter corresponding to the USB device. Because each device may contain multiple volumes, we can use a similar method to obtain information about all volumes, by comparing the device number, you can determine whether multiple volumes belong to the same device. Then, you can use the physical device name of the volume device to reverse query the symbol (querydosdevice) to obtain the drive letter corresponding to the volume, we can further obtain the drive letter of all volumes on a physical disk.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.