rng
rng

Reputation: 1

GetLogicalDriveStrings NT/SetupAPI alternative

I have to get a list of logical drives. I know I can use GetLogicalDriveStrings but I'm wondering if there's a NT API alternative I can use? Or even SetupAPI?

Upvotes: 0

Views: 217

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283773

If you want to correctly handle logical drives that aren't necessarily assigned letters, you'd use FindFirstVolume/FindNextVolume and GetVolumePathNamesForVolumeNameW.

MSDN has a sample named Displaying Volume Paths

If trying to access this information from kernel mode, try the Mount Point Manager (\Device\MountPointManager).

Upvotes: 2

Related Questions