Driver install withough disturbing currently running instances

I have a virtual bus driver with assorted virtual function drivers as
children. I’ve noticed that current instances of a device type are stopped
when new instances are installed. I’ve also noticed some devices in the
system have this behavior and some don’t.

For example, if I have a motherboard with dual Intel NIC’s, and uninstall on
of them in device manager, and then click scan for new hardware, the OS will
stop the first instance for a few seconds while the second instance is
getting installed. This is with whql signed drivers.

On the other hand, if I have a fibre channel controller and a new disk shows
up, the system does not stop running instances of disk.sys, it just updates
the new device data in the registry and I assume calls AddDevice on the
storage class driver.

Can anybody tell me how the OS decides if it needs to stop current instances
during install, and what I might need to do to make the OS not stop current
instances when I add new instances of my device? Just like the Intel NIC
drivers, the OS seems to always copy my driver files, which I assume is one
of the reasons it stops current instances.

All this is on W2K3 SP1.

Thanks.

  • Jan

You can reject query remove operations. In some situations this may result
in a ‘system must be rebooted …’ popup.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jan Bottorff
Sent: Saturday, September 23, 2006 12:48 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver install withough disturbing currently running
instances

I have a virtual bus driver with assorted virtual function drivers as
children. I’ve noticed that current instances of a device type are stopped
when new instances are installed. I’ve also noticed some devices in the
system have this behavior and some don’t.

For example, if I have a motherboard with dual Intel NIC’s, and uninstall on
of them in device manager, and then click scan for new hardware, the OS will
stop the first instance for a few seconds while the second instance is
getting installed. This is with whql signed drivers.

On the other hand, if I have a fibre channel controller and a new disk shows
up, the system does not stop running instances of disk.sys, it just updates
the new device data in the registry and I assume calls AddDevice on the
storage class driver.

Can anybody tell me how the OS decides if it needs to stop current instances
during install, and what I might need to do to make the OS not stop current
instances when I add new instances of my device? Just like the Intel NIC
drivers, the OS seems to always copy my driver files, which I assume is one
of the reasons it stops current instances.

All this is on W2K3 SP1.

Thanks.

  • Jan

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

When you do a scan for new hardware,use the devcon.exe with source in DDK to scan for new devices or you do IoInvalidateDeviceRelations from within a Driver you will get an IRP_MN_QUERY_DEVICE_RELATIONS with BusRelations to the BUS Driver. Here you give the PDOs that are currently active. If there new new in the list PnP will call with all the ADD PnP requests. If there are ones that have disappeared from the previous call, PnP will call with all the REMOVE PnP requests. See the toaster sample too. Note that it is heirachical with IRP_MN_QUERY_DEVICE_RELATIONS as you can Busses that contain ether more Busses or finally Children, where is picks up in the Device Tree is a parameter to IoValidateDeviceRelations or a parameter to the User api shown in devcon.exe.

-William Michael Jones

>When you do?a scan for new hardware,use the devcon.exe with source in DDK

to scan for new devices or you do IoInvalidateDeviceRelations from within a
Driver you will get an IRP_MN_QUERY_DEVICE_RELATIONS with BusRelations to
the BUS Driver.? Here you give the PDOs that are currently active. If there
new new in the list PnP will call with all the ADD PnP requests. If there
are ones that have disappeared from the previous call, PnP will call with
all the REMOVE PnP requests.? See the toaster sample too.? Note that it is
heirachical with IRP_MN_QUERY_DEVICE_RELATIONS as you can Busses that
contain ether more Busses or finally Children, where is picks up in the
Device Tree is a parameter to IoValidateDeviceRelations or a parameter to
the User api shown in devcon.exe.

What you said is not really accurate. The AddDevice routine will NOT get
called just because a new pdo has shown up in response to
IRP_MN_QUERY_DEVICE_RELATIONS. The OS will want in install a driver first,
after it queries the pdo for hardware and compatible PnP id’s.

What also happens is that during installation of the second instance, the
first instance is temporarily removed (just like disable in device manager).
The installation then presents the found new hardware dialog (unless I get
whql signatures) and copies the driver files (even though it already copied
exactly the same files for the first instance). The system will then start
both instances. If I add say the 15th instance, ALL previous instances are
stopped and then started again after the new instance is installed.

What I really want is for the PnP subsystem to look at the hardware id, and
say “oh, a new instance, let me do an install, and I see the install inf and
sys files are identical to the ones currently running the first instance, so
let me just call the class coinstallers (my device might be a network
device, but actually comes in a couple flavors) and then AddDevice on the
new instance, no need to touch the current running instance”. Not displaying
the found new hardware dialog is also desirable (this will be on a headless
server and the operator is probably a script on the network).

The behavior I’m looking for is really like when a new disk shows up on some
dynamic bus. The new instance is installed, but the current instances are
not disturbed.

  • Jan