Device I/O question

Hi,

I'm trying to communicate with a USB mass storage device. I'm opening the device with CreateFile(), and using "\\\\.\\PhysicalDriveX" or "\\\\.\\CdRomX" as the HANDLE parameter. The problem is that there can be more than 1 LUN in the device, and the individual LUNs can be hidden, which means there can also be 0 LUNs. In this case there won't be any PhysicalDriveX or CdRomX at all, but I still want to be able to address the device. What's the next step up I can go up to? I guess I have to go up to the parent of the drives, which would probably be the USB chip itself, which will always be around even when the physical drives are not presented? I've tried using CM_Get_Parent(), but this requires me to first have the Device Instance Handle of the PhysicalDriveX, which is not possible when it's not there.

How do I do this?

Thanks!
[898 byte] By [galapogos] at [2007-11-20 11:54:35]