I am making virtual bus driver for software USB device. I am facing following problem in “TargetDeviceRelation” while handling IRP_MN_QUERY_DEVICE_RELATION
- Should i create Device Object here.
- And is yes then what should i give in fourth parameter that is “Device Type” as this can be any type of software USB device.
So how does USB bus driver handle this type os situations.
Thanks in Advance
Chandrakant
the purpose of TargetDeviceRelations is to retrieve the PDO for a device stack. You should already have created the PDO by the time you get this and you’d just return a referenced pointer to it.
-p
From: xxxxx@lists.osr.com on behalf of xxxxx@yahoo.co.in
Sent: Fri 9/22/2006 5:37 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IRP_MN_QUERY_DEVICE_RELATION
I am making virtual bus driver for software USB device. I am facing following problem in “TargetDeviceRelation” while handling IRP_MN_QUERY_DEVICE_RELATION
- Should i create Device Object here.
- And is yes then what should i give in fourth parameter that is “Device Type” as this can be any type of software USB device.
So how does USB bus driver handle this type os situations.
Thanks in Advance
Chandrakant
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Thanks Peter,
So exactly at which location\IRP should i build PDO for my virtual USB device.
As when i am attaching virtual software USB device to my virtual bus driver, after enumeration of the new device… isnt this is the first IRP which bus driver gets for creating PDO for the device…
Chandrakant
have you considered using KMDF for your bus driver? it makes all of this complexity go away. there are 2 ways for creating PDOs in a bus driver. the first is to create it at detection time, but the you need to track whether it was reported to the OS in QDR/BusRelations or not to know when you can delete it. The second way is to create flag in your extension and then create the device object when you get the QDR/BusRelations, removing some of the tracking of the device object. but if you get a request to delete the device before it is created, you must remove the flag. KMDF encapsulates all of this in a WDFCHILDLIST.
d