Doron Holan wrote:
Since it is static you don’t really need to ever mark them as missing
since they will never disappear. if you mark them as missing during
D0Exit(), the stacks will be surprise removed and not come back until
you enumerate them again. Create a PDO for each function in
PrepareHardware() and that’s it.
Ok. I noticed that when I did delete the WDFDEVICE for the PDO or marked the PDO as missing, I got “KMDF has detected some potentially bad behavior, turn on WDF verifier” in my DebugView log. So, I actually don’t touch it at all after creation, and it seems to like this just fine.
why are you writing your own usb generic parent? what does the
inbox version lack?
Hey, I’m just pretending, remember? Ok, I’m not pretending. I just remember some post from Oney a few years ago saying “you have no business making your own generic parent…”
Basically, I need to support what I suppose are now called “interface collections” all the way back to Win2K to 1) support devices already in the field, 2) support new devices that are perceived to be too fragile to touch and just expose a configuration that wouldn’t require collections, 3) possibly use it for testing of our function drivers, 4) to gain the experience of making a bus driver, and 5) we have an issue with our existing one and our vendor isn’t writing me back
Thanks for the more detailed explanation about instance IDs. I’m fairly certain I get it now, after reading what you wrote and playing with it a little. I’m using uniqueID == false and the CreatePdo() function inside the toaster sample.
If I pass “01” to WdfPdoInitAssignInstanceID(), I get 6&3549e63&1&01. If I pass “hello”, I get 6&3549e63&1&hello. Incidentally, the 3549e63 is what I was seeing the other day from our existing bus driver (the parent’s hex value >> 3). It doesn’t match what usbccgp is doing, but since it’s supposed to be opaque, I’m fully content to leave that topic alone.
I’m thinking the only thing I’ll really need to do here is watch for USB serial numbers, and then flag UniqueId to TRUE and use the serial number for the instance ID. Otherwise I’ll get reinstallations (of the child devices only, I suppose) as I move the device from port to port. Yes?