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