How to enumerate USB Mass Storage devices?
- From: Wan-Hi <WanHi@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 02:43:02 -0700
hello.
i'm working on a hobby project for my own mp3 (usb mass storage) player and
try to enumerate all usb mass storage devices currently connected to my
computer. i've been working on this quite a while because i can't get through
the msdn efficiently enough. i planned to identify my player like this:
1) enumerate all disks (by SetupDiEnumDeviceInterfaces in conjunction with
guid GUID_DEVINTERFACE_DISK)
2) find out those who are mass storage devices
(IOCTL_STORAGE_GET_MEDIA_TYPES_EX)
3) get each mass storage device's partition info
4) get a handle to the volume
i chose the method above because i wanted to avoid a low level enumeration
through the usb hubs. now i'm stuck with step 2 because i don't know how to
find out the correct buffer size, needed by DeviceIoControl for the
IOCTL_STORAGE_GET_MEDIA_TYPES_EX flag. the documentation didn't explain a
proper use any further. so i wonder if any veteran can give me a hint, how to
find out the buffer size.
thanks.
wan-hi
.
- Follow-Ups:
- Re: How to enumerate USB Mass Storage devices?
- From: Robert Marquardt
- Re: How to enumerate USB Mass Storage devices?
- Prev by Date: Re: Correct group for WDM development??
- Next by Date: Re: 64 bit printer driver problem bugcheck 0x3b when print to file
- Previous by thread: Serious problem with IO manager and device removal
- Next by thread: Re: How to enumerate USB Mass Storage devices?
- Index(es):
Relevant Pages
|