single driver multiple classes ?

Hey there I have a PNP driver which sits under its own class let’s say class1 I need to use the same functionality but under another class class2 can I use same driver binary my guess would be no.
If the case then is it a good design to have multiple .sources files which will create multiple binaries and I can register each binary to be in its own class though same source behind both binaries…or same binary multiple inf something like that…Can you please point me in right direction…

Thanks in advance…

Could you be more specific? Are you describing class lower filters?
Which classes? It is possible, although unusual, to install the same
driver as a class filter for multiple classes, as installation is just
‘modify the registry’ plus whatever else you need to do to install
(e.g. KMDF, root enumerated control device etc.) In a kmdf root
enumerated control device class filter your inf file might specify
‘system’, your installation would be the usual root enumerated pnp
install for kmdf, and your install would also modify the class
registry entries to put your driver in as an upper or lower filter for
whichever classes you need to mess with.

Mark Roddy

On Thu, Feb 10, 2011 at 8:17 AM, wrote:
> Hey there I have a PNP driver which sits under its own class let’s say class1 I need to use the same functionality but under another class class2 can I use same driver binary my guess would be no.
> If the case then is it a good design to have multiple .sources files which will create multiple binaries and I can register each binary to be in its own class though same source behind both binaries…or same binary multiple inf something like that…Can you please point me in right direction…
>
> Thanks in advance…
>
> —
> 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
>

My driver falls under my own class let’s say class1 and I want the same PNP driver to be under net class as well…
So you say I can use a single inf so both classes are covered ?

Thanks

No I am saying that a class filter driver can do this. You are still
not describing what sort of driver you are implementing, but I am
guessing it is not a class filter. A pnp function driver or a device
filter driver can only be in one class.

Mark Roddy

On Thu, Feb 10, 2011 at 9:14 AM, wrote:
> My driver falls under my own class let’s say class1 and I want the same PNP driver to be under net class as well…
> So you say I can use a single inf so both classes are covered ?
>
> Thanks
>
> —
> 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
>

As long as no port driver is involved, there is nothing stopping you from having a driver in two different classes. The trick is that you need to figure out which of your devices belong to which class at runtime. The i8042prt example did this by using the different IOCTLs that was sent to it by the class drivers. You could have the inf write a devnode specific value. You must use different INFs for each class though, an inf can only belong to one class.

Excellent Doron,
That’s exactly I was looking for so I can have multiple infs each pointing to different class and that is okay PNP manager won’t barf…

Thanks

Actually I did a quick test and I see a bang displayed in PNP manager saying that "Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in the memory. (Code 30).
So not sure what’s wrong here…

Check the logs. I bet your driver instance in the other stack did not unload properly. Does a reboot fix it?

d

dent from a phine with no keynoard

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Thursday, February 10, 2011 10:37 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] single driver multiple classes ?

Actually I did a quick test and I see a bang displayed in PNP manager saying that "Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in the memory. (Code 30).
So not sure what’s wrong here…


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

Nope I did a reboot and it still the same…