driver load order

 

Dear All,

How can you load a kernel mode DLL (EXPORT_DRIVER) before the pnp driver that uses this dll ? This export driver (km dll) is without a hardware and export functionality to pnp pci drivers. But I don’t seem to find a way to load my hardware-less kernel-mode export driver before the pnp driver.

regards,

Hassan


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)

To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If you are using an inf file to install your driver you can specify the load
time there. Look under “Driver Information in the Registry” in the DDK help.
Otherwise if you are loading a legacy kernel mode driver you can specify the
load time in the Start value under you driver key.

Jim
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Hassan I Khan
Sent: Monday, May 07, 2001 10:18 PM
To: NT Developers Interest List
Subject: [ntdev] driver load order

Dear All,

How can you load a kernel mode DLL (EXPORT_DRIVER) before the pnp driver
that uses this dll ? This export driver (km dll) is without a hardware and
export functionality to pnp pci drivers. But I don’t seem to find a way to
load my hardware-less kernel-mode export driver before the pnp driver.

regards,

Hassan



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: xxxxx@youngendeavors.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

However if you have two drivers, at least one of which is a pnp driver, then
the load order relationships between these two drivers can be difficult to
get right. The problem is that PnP ignores the LoadOrderGroup and Tag fields
unless the driver in question is a boot start driver. One solution is to
make your kernel dll a boot start driver, as these are guaranteed to be
LOADED before other drivers. The other solution is to make both drivers boot
start, and specify load ordering the NT way. However, be aware that if you
attempt to install boot drivers at system setup time, for example using an
unattended setup script, that the rules are different.

Mark Roddy
Windows 2000/NT Consultant
Hollis Technology Solutions
xxxxx@hollistech.com
603 321 1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Jim Young
Sent: Monday, May 07, 2001 10:15 PM
To: NT Developers Interest List
Subject: [ntdev] RE: driver load order

If you are using an inf file to install your driver you can specify the
load time there. Look under “Driver Information in the Registry” in the DDK
help. Otherwise if you are loading a legacy kernel mode driver you can
specify the load time in the Start value under you driver key.

Jim
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Hassan I Khan
Sent: Monday, May 07, 2001 10:18 PM
To: NT Developers Interest List
Subject: [ntdev] driver load order

Dear All,

How can you load a kernel mode DLL (EXPORT_DRIVER) before the pnp driver
that uses this dll ? This export driver (km dll) is without a hardware and
export functionality to pnp pci drivers. But I don’t seem to find a way to
load my hardware-less kernel-mode export driver before the pnp driver.

regards,

Hassan


Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.


You are currently subscribed to ntdev as: xxxxx@youngendeavors.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@tellink.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks. Specfiying my kernel dll to be boot start solved my initial problem. The pnp driver is started after my dll is loaded.

But why does IoAttachDeviceToDeviceStack() is failing inside the kernel dll ?. Scenario is as follows:

From inside my AddDevice I am calling one of my dll function informing the DLL of a new device found. I am sending the PDO to the dll. The DLL creates its own device object and tries to do IoAttachDeviceToDeviceStack() using that PDO sent by my Pnp Driver. But it fails. And I have confirmed that PDO that I am receiving in the DLL is valid. What basic stuff I am missing here. Is it that you can’t call IoAttachDeviceToDeviceStack() with the same target PDO again ?

regards,

Hassan

 

From: “Mark Roddy”

>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] RE: driver load order
>Date: Tue, 8 May 2001 06:42:53 -0400
>
>However if you have two drivers, at least one of which is a pnp driver, then
>the load order relationships between these two drivers can be difficult to
>get right. The problem is that PnP ignores the LoadOrderGroup and Tag fields
>unless the driver in question is a boot start driver. One solution is to
>make your kernel dll a boot start driver, as these are guaranteed to be
>LOADED before other drivers. The other solution is to make both drivers boot
>start, and specify load ordering the NT way. However, be aware that if you
>attempt to install boot drivers at system setup time, for example using an
>unattended setup script, that the rules are different.
>
>Mark Roddy
>Windows 2000/NT Consultant
>Hollis Technology Solutions
>xxxxx@hollistech.com
>603 321 1032
>www.hollistech.com
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of Jim Young
> Sent: Monday, May 07, 2001 10:15 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: driver load order
>
>
> If you are using an inf file to install your driver you can specify the
>load time there. Look under “Driver Information in the Registry” in the DDK
>help. Otherwise if you are loading a legacy kernel mode driver you can
>specify the load time in the Start value under you driver key.
>
>
> Jim
> -----Original Message-----
> From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of Hassan I Khan
> Sent: Monday, May 07, 2001 10:18 PM
> To: NT Developers Interest List
> Subject: [ntdev] driver load order
>
>
>
>
>
> Dear All,
>
> How can you load a kernel mode DLL (EXPORT_DRIVER) before the pnp driver
>that uses this dll ? This export driver (km dll) is without a hardware and
>export functionality to pnp pci drivers. But I don’t seem to find a way to
>load my hardware-less kernel-mode export driver before the pnp driver.
>
> regards,
>
> Hassan
>
>
>
>----------------------------------------------------------------------------
> Get Your Private, Free E-mail from MSN Hotmail at
>http://www.hotmail.com.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@youngendeavors.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@tellink.net
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)

To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>

From inside my AddDevice I am calling one of my dll function informing the DLL of a new device found. I am sending the PDO to the dll. The DLL creates its own device object and tries to do IoAttachDeviceToDeviceStack() using that PDO sent by my Pnp Driver. But it fails. And I have confirmed that PDO that I am receiving in the DLL is valid. What basic stuff I am missing here. Is it that you can’t call IoAttachDeviceToDeviceStack() with the same target PDO again ?

I found the problem. I was not clearing the DO_DEVICE_INITIALIZING flag in
my AddDevice of the pnp driver. I found if you create a device object from
inside DriverEntry() the IO manager clears this flag for you. But device
objects created at any other place requires explicit clearing of this
flag.

regards,
Hassan


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com