Advertisement Jump to content
Sign in to follow this  

wmi and drive letter from device id

This topic is 2497 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wish extract from an usb and hd drive the drive letter of the drive and the pnpdeviceid.
i solved using wmi, but is too slow!!
especially this query:

stringstream strLogicalDiskToPartition;
strLogicalDiskToPartition << "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='Disk #1, Partition #0' } WHERE AssocClass = Win32_LogicalDiskToPartition";
hr = m_pSvc->ExecQuery(CComBSTR("WQL"), CComBSTR(strLogicalDiskToPartition.str().c_str()),

is possible using an api function get the drive letter of the device from the phisical device id (\\.\PHYSICALDRIVE1) or logical(Disk #1, Partition #0') in a reasonable time?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!