Loading and unloading device drivers. . . . .

Hi Everyone,

Under Windows 2000, is there a way to load and unload device drivers
without rebooting my computer?

Thanks in advance,

Joe McCloskey
Gamry Instruments.

Under any NT. Use a service start value of “demand”. Once you have created
the required registry entryes ofr the driver, using SCM, or manualy, you
can simply use net.exe to start stop your service. Like:

net start mydriver
net stop mydriver

Or download the nice GUI osrloader.exe from OSR’s web site. This if you dont
wanna write your own tool.

Dan

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 6:19 PM
Subject: [ntdev] Loading and unloading device drivers. . . . .

> Hi Everyone,
>
> Under Windows 2000, is there a way to load and unload device drivers
> without rebooting my computer?
>
>
> Thanks in advance,
>
> Joe McCloskey
> Gamry Instruments.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

This only works on non PNP device drivers. You cannot do this for a PNP
device driver (try “net stop serial” to test it out).

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Dan Partelly [mailto:xxxxx@rdsor.ro]
Sent: Friday, July 05, 2002 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Loading and unloading device drivers. . . . .

Under any NT. Use a service start value of “demand”. Once you have
created
the required registry entryes ofr the driver, using SCM, or manualy,
you
can simply use net.exe to start stop your service. Like:

net start mydriver
net stop mydriver

Or download the nice GUI osrloader.exe from OSR’s web site. This if you
dont
wanna write your own tool.

Dan

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 6:19 PM
Subject: [ntdev] Loading and unloading device drivers. . . . .

> Hi Everyone,
>
> Under Windows 2000, is there a way to load and unload device drivers
> without rebooting my computer?
>
>
> Thanks in advance,
>
> Joe McCloskey
> Gamry Instruments.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

True, but what would be the posters need to use a PNP driver this way ?
I responded to the question as I understood the context, maybe clarification
is indeed important.

Dan

----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 9:28 PM
Subject: [ntdev] Re: Loading and unloading device drivers. . . . .

This only works on non PNP device drivers. You cannot do this for a PNP
device driver (try “net stop serial” to test it out).

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Dan Partelly [mailto:xxxxx@rdsor.ro]
Sent: Friday, July 05, 2002 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Loading and unloading device drivers. . . . .

Under any NT. Use a service start value of “demand”. Once you have
created
the required registry entryes ofr the driver, using SCM, or manualy,
you
can simply use net.exe to start stop your service. Like:

net start mydriver
net stop mydriver

Or download the nice GUI osrloader.exe from OSR’s web site. This if you
dont
wanna write your own tool.

Dan

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 6:19 PM
Subject: [ntdev] Loading and unloading device drivers. . . . .

> Hi Everyone,
>
> Under Windows 2000, is there a way to load and unload device drivers
> without rebooting my computer?
>
>
> Thanks in advance,
>
> Joe McCloskey
> Gamry Instruments.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@rdsor.ro
To unsubscribe send a blank email to %%email.unsub%%

Doing a disable/enable via DeviceManager or own SetupDi-App may help
for PnP-Drivers. Be sure to have no open references to your driver.

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann E+V GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“The race for Quality has no finish line.”

This only works on non PNP device drivers. You cannot do this for a PNP
device driver (try “net stop serial” to test it out).

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Dan Partelly [mailto:xxxxx@rdsor.ro]
Sent: Friday, July 05, 2002 8:26 AM
To: NT Developers Interest List
Subject: Re: Loading and unloading device drivers. . . . .

Under any NT. Use a service start value of “demand”. Once you have
created
the required registry entryes ofr the driver, using SCM, or manualy,
you
can simply use net.exe to start stop your service. Like:

net start mydriver
net stop mydriver

Or download the nice GUI osrloader.exe from OSR’s web site. This if you
dont
wanna write your own tool.

Dan

----- Original Message -----
From:
> To: “NT Developers Interest List”
> Sent: Friday, July 05, 2002 6:19 PM
> Subject: Loading and unloading device drivers. . . . .

>> Hi Everyone,
>>
>> Under Windows 2000, is there a way to load and unload device drivers
>> without rebooting my computer?
>>
>>
>> Thanks in advance,
>>
>> Joe McCloskey
>> Gamry Instruments.
>>
>>
>> —
>> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
>> To unsubscribe send a blank email to %%email.unsub%%
>>

> —
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to %%email.unsub%%

> —
> You are currently subscribed to ntdev as: xxxxx@stollmann.de
> To unsubscribe send a blank email to %%email.unsub%%

Joe,

I had the same question last month and got help from this newsgroup. Norbert
is correct - make sure you have no open references to your driver. There are
a few things that have to be taken care of. For example,

  • Make sure that you get PnP requests from the PnP manager. I didn’t call
    IoAttachDeviceToDeviceStack and as a result, I never receive any PnP
    request.

  • Make sure that you handle all PnP requests properly - either by yourself
    or pass it down. I by mistake returned NT_SUCCESS as a default return value
    and that caused system crash.

  • When you disable your device, the IO manager will send you a few Pnp
    requests including IRP_MN_REMOVE_DEVICE. Make sure you clean up whatever was
    allocated by the device and remove the device itself.

  • And don’t forget to supply the DriverUnload module. After your device has
    been successfully and cleanly removed, the driver will get unloaded
    automatically.

I guess these are all basic steps… But since PnP driver was new to me, it
took me a few days to figure out why driver wasn’t unloaded.

Good luck,

----- Original Message -----
From: “Norbert Kawulski”
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 11:43 AM
Subject: [ntdev] Re: Loading and unloading device drivers. . . . .

>
> Doing a disable/enable via DeviceManager or own SetupDi-App may help
> for PnP-Drivers. Be sure to have no open references to your driver.
> -----------------------------------------------------------------
> | Norbert Kawulski | mailto:xxxxx@stollmann.de |
> | Stollmann E+V GmbH, Development | http://www.stollmann.de |
> --If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–
>
> “The race for Quality has no finish line.”
>
> > This only works on non PNP device drivers. You cannot do this for a PNP
> > device driver (try “net stop serial” to test it out).
>
> > D
>
> > This posting is provided “AS IS” with no warranties, and confers no
> > rights.
>
> > -----Original Message-----
> > From: Dan Partelly [mailto:xxxxx@rdsor.ro]
> > Sent: Friday, July 05, 2002 8:26 AM
> > To: NT Developers Interest List
> > Subject: Re: Loading and unloading device drivers. . . . .
>
> > Under any NT. Use a service start value of “demand”. Once you have
> > created
> > the required registry entryes ofr the driver, using SCM, or manualy,
> > you
> > can simply use net.exe to start stop your service. Like:
>
> > net start mydriver
> > net stop mydriver
>
> > Or download the nice GUI osrloader.exe from OSR’s web site. This if you
> > dont
> > wanna write your own tool.
>
> > Dan
>
> > ----- Original Message -----
> > From:
> > To: “NT Developers Interest List”
> > Sent: Friday, July 05, 2002 6:19 PM
> > Subject: Loading and unloading device drivers. . . . .
>
>
> >> Hi Everyone,
> >>
> >> Under Windows 2000, is there a way to load and unload device drivers
> >> without rebooting my computer?
> >>
> >>
> >> Thanks in advance,
> >>
> >> Joe McCloskey
> >> Gamry Instruments.
> >>
> >>
> >> —
> >> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> >> To unsubscribe send a blank email to %%email.unsub%%
> >>
>
>
>
> > —
> > You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> > To unsubscribe send a blank email to %%email.unsub%%
>
>
> > —
> > You are currently subscribed to ntdev as: xxxxx@stollmann.de
> > To unsubscribe send a blank email to %%email.unsub%%
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sbcglobal.net
> To unsubscribe send a blank email to %%email.unsub%%

Surely.
For PnP drivers, it is disabling all its devices.
For non-PnP ones, it is “net stop” or ControlService API.

Max

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, July 05, 2002 7:19 PM
Subject: [ntdev] Loading and unloading device drivers. . . . .

> Hi Everyone,
>
> Under Windows 2000, is there a way to load and unload device drivers
> without rebooting my computer?
>
>
> Thanks in advance,
>
> Joe McCloskey
> Gamry Instruments.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Joe,

You can use device manager and disable the device to unload, and enable to
reload as has been stated by others here. BTW, the driver will only unload
if every instance of the device is disabled.

Also, you can disable/enable programmatically. Look at the devcon sample in
the latest DDK to see how that is done. In fact, the devcon sample is
essentially a command line device manager with source, it has a wealth of
useful information in it.


Bill McKenzie

wrote in message news:xxxxx@ntdev…
>
> Hi Everyone,
>
> Under Windows 2000, is there a way to load and unload device drivers
> without rebooting my computer?
>
>
> Thanks in advance,
>
> Joe McCloskey
> Gamry Instruments.
>
>
>