Driver Load order in the INF file

Hello,
Is there a way to use the same .INF file to load two different WDM drivers? I’d like to load my main driver first and then load a secondary driver. I’m not using an Upper filter or Lower filter driver so how to do this escapes me.

The main driver actually controls hardware whereas the second driver just uses an exported variable I get back from the main driver. I need to load the main driver first and then the secondary one. If I can do this within one .INF file then that would be ideal. I don’t want the user to have to use an SCM tool that starts the second driver after the first is installed.

Thanks.

It sounds like you have a PNP driver and a legacy driver. Using an
exported variable from the PNP driver is a really bad idea since it could
be unloaded without any control from your legacy driver. Consider, making
the exported variable a device interface, and use
IoRegisterPlugPlayNotification to have the PNP driver inform the legacy
driver of the presence of the interface. This eliminates most of the
dependancies on load ordering, and guarantees that once you open the
interface the PNP driver will not disappear.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Hello,
> Is there a way to use the same .INF file to load two different WDM
> drivers? I’d like to load my main driver first and then load a secondary
> driver. I’m not using an Upper filter or Lower filter driver so how to
> do this escapes me.
>
> The main driver actually controls hardware whereas the second driver just
> uses an exported variable I get back from the main driver. I need to
> load the main driver first and then the secondary one. If I can do this
> within one .INF file then that would be ideal. I don’t want the user to
> have to use an SCM tool that starts the second driver after the first is
> installed.
>
> Thanks.
>

You could make the first driver a bus driver and enumerate a PDO with a device ID that triggers the installation of the second driver. This might be nice if you want the “service” to only be running when the other devices are present, and you could use I/O controls rather than exported functions to transfer data between the two.

Making a bus driver with KMDF is pretty trivial these days.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, March 01, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver Load order in the INF file

Hello,
Is there a way to use the same .INF file to load two different WDM drivers? I’d like to load my main driver first and then load a secondary driver. I’m not using an Upper filter or Lower filter driver so how to do this escapes me.

The main driver actually controls hardware whereas the second driver just uses an exported variable I get back from the main driver. I need to load the main driver first and then the secondary one. If I can do this within one .INF file then that would be ideal. I don’t want the user to have to use an SCM tool that starts the second driver after the first is installed.

Thanks.


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

If this is a true export / import dependency (e.g. it is in the driver’s import list), the second driver will be loaded as a DLL before the main driver. You have asked this question before in terms of design and got some advice not to go down this route. Again, I would strongly encourage you not to go down this design path, there are cleaner ways to do this.

d

Thanks, guys.
I decided to implement an Upper Filter driver. This Filter Driver has it’s own Device Object which is not associated with the stack it is filtering. This allows me to have a separate symbolic link which is used to access ioctl’s in the Filter Driver. This also eliminates the need to figure out a load order method for both drivers.

Register a PnP device interface in the first driver.
Use device interface arrival notification in the second driver.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hello,
> Is there a way to use the same .INF file to load two different WDM drivers?
I’d like to load my main driver first and then load a secondary driver. I’m
not using an Upper filter or Lower filter driver so how to do this escapes me.
>
> The main driver actually controls hardware whereas the second driver just
uses an exported variable I get back from the main driver. I need to load the
main driver first and then the secondary one. If I can do this within one .INF
file then that would be ideal. I don’t want the user to have to use an SCM
tool that starts the second driver after the first is installed.
>
> Thanks.
>