简体   繁体   中英

Detecting SD Card drives

My program needs to find out SD Cards among all local drives. One can easily identify removable drives (using GetLogicalDrivesStrings() and GetDriveType() ) but knowing which ones are truly SD cards seems harder.

There are quite a few questions (including here , here , here and here ) but no complete answer (many focus on USB). Some say it is impossible to distinguish SD Cards from USB, however Windows Explorer displays different drive icons for SD cards (at least in Windows 7) hence it does distinguish which is which.

Extra bonus for code NOT based on WMI since my program is still using native Win32/MFC! Can some DeviceIoControl() properties help? Now, if someone has a C#/.NET solution, I'd still happily read it!

Should be possible with DevicePowerEnumDevices

A USB Flash Drive should have PDCAP_D2_SUPPORTED under "Power data" in Device Manager, but not a memory card.

See discussion here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM