WDM Driver Start order

When I handle IRP_MN_START_DEVICE in my driver, I need to get an interface from another driver. My problem is that
the other driver may not have started yet (and therefore, the interface I need is not yet available)!

I need to insure that one driver starts before another. Is there a way to tell the plug and play manager to start
them in the correct order?

I Tried to be independent of the plug and play manager by doing the following.

I used IoRegisterPlugPlayNotification to get a callback when the interface became available and just return
STATUS_PENDING from my IRP_MN_START_DEVICE handler. The callback would complete the IRP_MN_START_DEVICE when it
got the interface. This does not work because the the other driver is not started until my driver completes its
IRP_MN_START_DEVICE.

Thanks,
Anthony


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

Refer to the DDK Docs “Specifying Driver Load Order”. I believe this
might help.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install
/create-inf_7ap3.asp

Youssef.

-----Original Message-----
From: Anthony Malizia [mailto:xxxxx@Matrox.COM]
Sent: Wednesday, August 15, 2001 2:12 PM
To: NT Developers Interest List
Subject: [ntdev] WDM Driver Start order

When I handle IRP_MN_START_DEVICE in my driver, I need to get an
interface from another driver. My problem is that
the other driver may not have started yet (and therefore, the interface
I need is not yet available)!

I need to insure that one driver starts before another. Is there a way
to tell the plug and play manager to start
them in the correct order?

I Tried to be independent of the plug and play manager by doing the
following.

I used IoRegisterPlugPlayNotification to get a callback when the
interface became available and just return
STATUS_PENDING from my IRP_MN_START_DEVICE handler. The callback would
complete the IRP_MN_START_DEVICE when it
got the interface. This does not work because the the other driver is
not started until my driver completes its
IRP_MN_START_DEVICE.

Thanks,
Anthony


You are currently subscribed to ntdev as: xxxxx@microsoft.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

Which documents basically say that PnP drivers ought not to depend on the
load order of devices that are not in their PnP stack.

So the original poster has a dilemma not readily solved by the current NT
driver architectural recommendations. He could make one of his drivers (the
one he depends on) boot start, but that will only work if he can control the
configuration of that driver, otherwise he needs to rethink his
requirements. Boot start drivers are started before non boot start drivers.

If the dependent driver is a function driver that exposes at least one
device interface, one mechanism that could work is to defer setting the
device interface (or interfaces) enabled until the interface the driver
depends on is available, (detected using pnp notification.) StartDevice
could then return normally, (rather than pending your StartDevice
operation,) but with the interface disabled.

Otherwise he might simply have to set a state in his driver that pends or
fails data IO requests until his depended-on interface arrives.

-----Original Message-----
From: Youssef Barakat [mailto:xxxxx@microsoft.com]
Sent: Thursday, August 16, 2001 1:19 PM
To: NT Developers Interest List
Subject: [ntdev] RE: WDM Driver Start order

Refer to the DDK Docs “Specifying Driver Load Order”. I believe this might
help.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install
/create-inf_7ap3.asp

Youssef.

-----Original Message-----
From: Anthony Malizia [mailto:xxxxx@Matrox.COM]
Sent: Wednesday, August 15, 2001 2:12 PM
To: NT Developers Interest List
Subject: [ntdev] WDM Driver Start order

When I handle IRP_MN_START_DEVICE in my driver, I need to get an interface
from another driver. My problem is that the other driver may not have
started yet (and therefore, the interface I need is not yet available)!

I need to insure that one driver starts before another. Is there a way to
tell the plug and play manager to start them in the correct order?

I Tried to be independent of the plug and play manager by doing the
following.

I used IoRegisterPlugPlayNotification to get a callback when the interface
became available and just return STATUS_PENDING from my IRP_MN_START_DEVICE
handler. The callback would complete the IRP_MN_START_DEVICE when it got
the interface. This does not work because the the other driver is not
started until my driver completes its IRP_MN_START_DEVICE.

Thanks,
Anthony


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


You are currently subscribed to ntdev as: xxxxx@stratus.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

> I used IoRegisterPlugPlayNotification to get a callback when the interface
became available

Correct.

STATUS_PENDING from my IRP_MN_START_DEVICE handler.

This is wrong.
You must proceed with START correctly, and report START OK to PNP.
Nevertheless, your device is in “dead” mode and will be such till the
callback.

Another approach:

  • do not register the driver as a PnP device of this stack at all.
  • call IoRegisterPlugPlayNotification from DriverEntry.
  • in the callback, attach to the device specified to the callback and be
    ready to process all its IRPs, including the PnP ones.

Max


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