How to enumerate USB Mass Storage devices?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
.



Relevant Pages

  • Re: USB Mass storage driver problem
    ... I expect there are still issues with certain USB mass storage devices, ... I want to ask if a problem with USB mass storage driver in Win CE 5.0 ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How to enumerate USB Mass Storage devices?
    ... 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. ...
    (microsoft.public.development.device.drivers)
  • Re: Problem with USB Mass Storage Devices
    ... I'm looking into problems with mass storage devices at the moment also, ... there doesn't look to be any low level error (dwUsbErr is ... in the registry for USB mass storage. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB mass storage
    ... I think that you have added the wrong USB Mass Storage. ... Is there a way to have both Active sync and USB mass storage? ... I tried changing the registry entries as shown below. ... ; idVendor must be changed. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How to export linux fs using USB MassStorage device
    ... system accessible from a Windows System using USB mass storage. ... I know about the usb gadget driver g_file_store. ... As I want to be able to access the mass storage from Windows the ...
    (comp.os.linux.embedded)