Hello,
How do I load and unload a PnP device driver on a W2K target without
rebooting ? From the list archives, I find that it can be done by
disabling and enabling the device in the Device Manager. However, I tried
it and found that it doesn’t work. Is there any other way to do it ?
Regards,
Sunil Jigyasu.
xxxxx@vigorsoft.com wrote:
How do I load and unload a PnP device driver on a W2K target without
rebooting ? From the list archives, I find that it can be done by
disabling and enabling the device in the Device Manager. However, I tried
it and found that it doesn’t work. Is there any other way to do it ?
When you say “doesn’t work”, what exactly do you mean? The system will
send QUERY_REMOVE_DEVICE and REMOVE_DEVICE PnP requests. If your driver
handles them correctly, the system should unload your driver. If you
think you’re handling the PnP requests correctly, an application having
a handle open to your device would prevent you from getting the
REMOVE_DEVICE.
Incidentally, in 98/Me, a disable/enable cycle merely stops and then
restarts the device without removing it.
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com
On Wed, 26 Mar 2003 05:39:26 -0500, xxxxx@vigorsoft.com wrote:
Does the disable/enable option actually show up when you do a
right-click on the device in the Device Manager? Its possible that
the device driver is managing a device that cannot be disabled - for
example lets say you have a disk class driver replacement for some
reason. If the disk itself contains the OS, hibernation, or paging
file you won’t be able to disable the device.
Hello,
How do I load and unload a PnP device driver on a W2K target without
rebooting ? From the list archives, I find that it can be done by
disabling and enabling the device in the Device Manager. However, I tried
it and found that it doesn’t work. Is there any other way to do it ?
Regards,
Sunil Jigyasu.
Is your driver a storage device? Most of them cannot unload.
----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Wednesday, March 26, 2003 1:39 PM
Subject: [ntdev] PnP Driver load unload on W2K
> Hello,
> How do I load and unload a PnP device driver on a W2K target without
> rebooting ? From the list archives, I find that it can be done by
> disabling and enabling the device in the Device Manager. However, I
tried
> it and found that it doesn’t work. Is there any other way to do it
?
>
> Regards,
> Sunil Jigyasu.
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>
No, Maxim, the driver is not for storage device but a early non-VGA PCI
device. Yes, Mr.Oney, I checked DispatchPnp routine and it is indeed
called when I enable but isn’t called when I disable but not with expected
MN codes. The MN code sent is unknown. Anyway, now I understand why I
need to add complete PnP support at the first go. Also, the
enable-disable with the Device Manager should probably work for loading
and unloading. I believe there isn’t another way to do it, and I should
proceed with the same, correct ?
Regards,
Sunil.