Link to home
Start Free TrialLog in
Avatar of olegsp
olegsp

asked on

Detecting removable hard drive

How can I tall, using MS Visual C++ code, that a harddrive (F:, for instance) is removable (USB flash, for instance) or not?
Avatar of vachooho
vachooho
Flag of United States of America image

Its simple:o)
well maybe not quite
you need to use SetupDiXXX class of functions

use SetupDiGetClassDevs to enumerate devices of certain class
examine content of
devguid.h    // Device guids
setupapi.h   // SetupDiXXX
cfgmgr32.h
header files

if that will help - here is MS knowledge base sample on how to enumerate CD-ROM drives and their properties
http://support.microsoft.com/kb/305184

This should give you basic idea - or will scare you off  :o)

Ask me if you need further help
ASKER CERTIFIED SOLUTION
Avatar of olegdasha
olegdasha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial