what causes OS to require reboot when updating driver

When I make changes to the driver I am developing (on win2k), I use the
following steps to update it.

1 - build the driver in its local directory
2 - from device manager, disable the driver
3 - copy the .sys to c:\winnt\system32\drivers
4 - from device manager, enable the driver
5 - run my app that opens the driver

My issue is that, sometimes, for no obvious reason, Win2k decides that the
system needs a reboot to either disable or enable the driver. Sometimes it
works fine with no reboot required. I can’t see any dependencies in my
driver that would cause this.

I expect to be reprimanded by someone out there for not using the “legal
way”;), but I really hate the Device Manager wizards, and obviously I need
to make sure the driver is unloaded before copying the new one into the
standard driver directory. The wizards don’t always do what I expect -

So, while any non-wizard suggestions to updating drivers would be
appreciated, I was mainly wondering if anyone knew the exact criterion that
the os uses to decide whether a reboot is required when disabling/enabling a
driver from Device Manager. (I make sure there are no current references to
the driver when I am doing this.)

thanks,
Jeff Larson

Most likely you have outstanding references/handles on your driver.

Do ‘kd>!object’ on your device object.

HTH,
Calvin

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Larson, Jeffrey [mailto:xxxxx@analogic.com]
Sent: Friday, September 03, 2004 11:54 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] what causes OS to require reboot when updating driver

When I make changes to the driver I am developing (on win2k), I use the
following steps to update it.

1 - build the driver in its local directory
2 - from device manager, disable the driver
3 - copy the .sys to c:\winnt\system32\drivers
4 - from device manager, enable the driver
5 - run my app that opens the driver

My issue is that, sometimes, for no obvious reason, Win2k decides that the
system needs a reboot to either disable or enable the driver. Sometimes it
works fine with no reboot required. I can’t see any dependencies in my
driver that would cause this.

I expect to be reprimanded by someone out there for not using the “legal
way”;), but I really hate the Device Manager wizards, and obviously I need
to make sure the driver is unloaded before copying the new one into the
standard driver directory. The wizards don’t always do what I expect -

So, while any non-wizard suggestions to updating drivers would be
appreciated, I was mainly wondering if anyone knew the exact criterion that
the os uses to decide whether a reboot is required when disabling/enabling a
driver from Device Manager. (I make sure there are no current references to
the driver when I am doing this.)

thanks,
Jeff Larson


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Larson, Jeffrey[SMTP:xxxxx@analogic.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, September 03, 2004 5:54 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] what causes OS to require reboot when updating driver

When I make changes to the driver I am developing (on win2k), I use the following steps to update it.

1 - build the driver in its local directory
2 - from device manager, disable the driver
3 - copy the .sys to c:\winnt\system32\drivers
4 - from device manager, enable the driver
5 - run my app that opens the driver

My issue is that, sometimes, for no obvious reason, Win2k decides that the system needs a reboot to either disable or enable the driver. Sometimes it works fine with no reboot required. I can’t see any dependencies in my driver that would cause this.

Usually it is because driver can’t be unloaded for some reason: opened handles.

I expect to be reprimanded by someone out there for not using the “legal way”;), but I really hate the Device Manager wizards, and obviously I need to make sure the driver is unloaded before copying the new one into the standard driver directory. The wizards don’t always do what I expect -

Actually, you can safely replace driver image without unloading. But you still have to reload driver to use new one and disable/enable method is right. It is IMO quite correct for debugging purposes. I use it every day.

So, while any non-wizard suggestions to updating drivers would be appreciated, I was mainly wondering if anyone knew the exact criterion that the os uses to decide whether a reboot is required when disabling/enabling a driver from Device Manager. (I make sure there are no current references to the driver when I am doing this.)

Well, using Device Manager GUI is PITA. Instead, I use a command line tool which disables/enables devices using SetupDi calls. I wrote my own years before but I believe DevCon tool from DDK (there are also sources) can be used for this purpose as well.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]