I still do not see a need for a bus driver. You can create and change the state of multiple instances of the same device interface guid in one driver. The caveat is that each instance must have its own unique reference string (you could probably use the 3rd party’s driver’s interfaces string (minus the \s) as your own reference string). You can differentiate which interface is being opened by inspecting the filename in your IRP_MJ_CREATE handler and comparing to the active instances you have enabled.
I think you are too quick to dismiss the filter idea though. It is a much cleaner solution and IMHO, not as hacky or error prone as you describe.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Tuesday, January 29, 2008 2:25 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] How to add new interface and functionality to the existing device stack
From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Tuesday, January 29, 2008 9:42 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] How to add new interface and functionality to the existing device stack
Is the requirement that your driver load on demand when the other device appears created by the fact that you do not want the new device interface to always be present? E.g. that it is only available when the 3rd party driver is present?
Exactly. It is because other software will wait for my new devices and they can’t work until real hardware is present.
If so, as don suggested, you can always be a root enumerated device and then selectively enable/disable your new device interface based on the presence of the 3rd party device stack.
Yes, I understand it. But it is ugly. As I wrote in reply to Don (my mails are delayed for some reason…), I don’t know how many 3rd party devices will be present. In fact, there can be more devices of different kind which I have to support. So if I understand it correctly, I’d have to install sufficient number of root enumerated devices and enable/disable interfaces as hw appears and disappears.
BTW, what do you say about virtual bus idea? Is it feasible for this purpose? Looks like an overkill to me but in principle it seems correct. Basically, I need to create one or more instances of virtual hardware (new interface) using real hw (3rd party or OS drivers).
OTOH, being a filter on top of the 3rd part device stack would be my initial stab at a solution. So what if you see all the traffic for the 3rd party device. IoSkip/IoCall is not going to add any noticeable overhead.
You’re right but it is even uglier
I prefer clean and correct design. In addition, adding a filter, even pass-through can lead to unexpected problems with 3rd party drivers or software using them.
In other words, I hoped there is some supported solution for this kind of problem which I missed. It seems as there isn’t which is a bit strange because my requirements don’t seem so unusual.
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer