Yeah, it's me again. This time, I have a composite device here that is
configured like the below.
Interface 0:
- bulk IN endpoint
- bulk OUT endpoint
- interrupt IN endpoint
Interface 1:
- bulk IN endpoint
- bulk OUT endpoint
I load the generic parent driver (usbhub, I'm on Win2k) for this device
which then enumerates two child devices. So far, so good.
I am using the same function driver binary for both interfaces (PDOs)
-- although it is set up with a different service name and different
binary name in the other INF file. If the interrupt endpoint is not
seen, the driver just removes some functionality on the fly.
If it matters, the first interface is "modem" class and the second is
"ports" class. I call WdfDeviceCreateDeviceInterface conditionally,
either passing GUID_DEVINTERFACE_MODEM or GUID_DEVINTERFACE_COMPORT.
I can load my function driver successfully on the first interface
without any trouble.
When it loads on the second, I am getting *two* calls into my AddDevice
routine, and *two* calls into my PrepareHardware. Inside
PrepareHardware, I can see that the two WDFDEVICE handles that I'm
given are different (say, 0x7CAD0FF8 versus 0x7CA97FF8). Naturally,
when I go to call WdfUsbTargetDeviceCreate() inside PrepareHardware,
the second call fails out.
I can't even fathom a guess as to why this happens. Any ideas?