views:

146

answers:

1

I am writing an application that allows Syncing to USB storage devices and I would like to display the FriendlyName for the devices that can be found in the registry at HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR\

I am using GetLogicalDrives to get the list of available devices, GetDriveType to filter by DRIVE_REMOVABLE and GetVolumeInformation to retrieve the volume name and serial number.

I would like to also get the FriendlyName out of the registry by linking the USBSTOR entries to a drive letter so I know which entry is which drive.

+1  A: 

Tricky but possible. Have a peek at my post here. That approach is roughly in the right direction here, too. You don't want to use undocumented registry fields. Instead, use the Device Information Functions from the SetupAPI and Configuration Management API

MSalters