difference between disable and uninstall driver

Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?

do the DriverUnload function gets called in both cases?

thanks,
Tomer Goldberg

No DriverUnload should get called only in case of uninstall.
In response of stop driver will be getting IRP_MN_STOP irp, in response of
this IRP driver should just stop the device and freed all the hardware
resources. In this case pnp manager just modifies the stat of driver but
driver remains loaded.
However in response of uninstall driver will be getting IRP_MN_REMOVE irp
first then pnp manager will be calling driver unload entry point.

Dev

-----Original Message-----
From: Tomer Goldberg [mailto:tomerg22@012.net.il]
Sent: Friday, November 19, 2004 7:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] difference between disable and uninstall driver

Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?

do the DriverUnload function gets called in both cases?

thanks,
Tomer Goldberg

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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

This is incorrect on both accounts. Both disable and uninstall result in a query remove + remove being sent to the driver. IRP_MN_STOP is *only* for resource rebalance on win2k. On win9x, disable did send a stop, but Tomer asked about win2k and forward.

If the device being operated on is the last device your driver controls, unload will run. If it is not, all the other instances will stay running. Disable or uninstall operate on the device node itsef, not necessarily on the services that are assigned to it. By that I mean that disabling the device in device manager does not disable the controlling service or assigned filters (ie their start type in the registry is not set to 0x4), rather it disables the state of the device node itself.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Dsingh@in.safenet-inc.com
Sent: Thursday, November 18, 2004 8:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] difference between disable and uninstall driver

No DriverUnload should get called only in case of uninstall.
In response of stop driver will be getting IRP_MN_STOP irp, in response of this IRP driver should just stop the device and freed all the hardware resources. In this case pnp manager just modifies the stat of driver but driver remains loaded.
However in response of uninstall driver will be getting IRP_MN_REMOVE irp first then pnp manager will be calling driver unload entry point.
?
Dev
-----Original Message-----
From: Tomer Goldberg [mailto:tomerg22@012.net.il]
Sent: Friday, November 19, 2004 7:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] difference between disable and uninstall driver
?Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?
?
do the DriverUnload function gets called in both cases?
?
thanks,
Tomer Goldberg

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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

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

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

Oooops…
Seems I am loosing things :slight_smile:
Thanks correcting me Doron.

Dev

-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Friday, November 19, 2004 1:48 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] difference between disable and uninstall driver

This is incorrect on both accounts. Both disable and uninstall result in a
query remove + remove being sent to the driver. IRP_MN_STOP is *only* for
resource rebalance on win2k. On win9x, disable did send a stop, but Tomer
asked about win2k and forward.

If the device being operated on is the last device your driver controls,
unload will run. If it is not, all the other instances will stay running.
Disable or uninstall operate on the device node itsef, not necessarily on
the services that are assigned to it. By that I mean that disabling the
device in device manager does not disable the controlling service or
assigned filters (ie their start type in the registry is not set to 0x4),
rather it disables the state of the device node itself.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Dsingh@in.safenet-inc.com
Sent: Thursday, November 18, 2004 8:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] difference between disable and uninstall driver

No DriverUnload should get called only in case of uninstall.
In response of stop driver will be getting IRP_MN_STOP irp, in response of
this IRP driver should just stop the device and freed all the hardware
resources. In this case pnp manager just modifies the stat of driver but
driver remains loaded.
However in response of uninstall driver will be getting IRP_MN_REMOVE irp
first then pnp manager will be calling driver unload entry point.
?
Dev
-----Original Message-----
From: Tomer Goldberg [mailto:tomerg22@012.net.il]
Sent: Friday, November 19, 2004 7:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] difference between disable and uninstall driver
?Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?
?
do the DriverUnload function gets called in both cases?
?
thanks,
Tomer Goldberg

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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

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

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


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

you’ve misunderstood disable.

stop is a transient condition that occurs when PNP needs to reassign
device resources. It cannot be initiated from any UI.

disable and uninstall both “remove” the drivers from the device-node,
and both can cause DriverUnload to be called if that was the last device
the driver was exposing. Uninstall goes through the added step of
removing the registry information for the device node so that it will be
seen as “new” the next time it’s detected.

-p


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Dsingh@in.safenet-inc.com
Sent: Thursday, November 18, 2004 8:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] difference between disable and uninstall
driver

No DriverUnload should get called only in case of uninstall.
In response of stop driver will be getting IRP_MN_STOP irp, in
response of this IRP driver should just stop the device and freed all
the hardware resources. In this case pnp manager just modifies the stat
of driver but driver remains loaded.
However in response of uninstall driver will be getting
IRP_MN_REMOVE irp first then pnp manager will be calling driver unload
entry point.

Dev

-----Original Message-----
From: Tomer Goldberg [mailto:tomerg22@012.net.il]
Sent: Friday, November 19, 2004 7:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] difference between disable and
uninstall driver

Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?

do the DriverUnload function gets called in both cases?

thanks,
Tomer Goldberg

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

You are currently subscribed to ntdev as: unknown
lmsubst tag argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com


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

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

“Disable” from Device Manager sends MN_REMOVE_DEVICE, and not MN_STOP_DEVICE.

For the functional driver, “Disable” is the same as “Uninstall”.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Dsingh@in.safenet-inc.com
To: Windows System Software Devs Interest List
Sent: Friday, November 19, 2004 7:58 AM
Subject: RE: [ntdev] difference between disable and uninstall driver

No DriverUnload should get called only in case of uninstall.
In response of stop driver will be getting IRP_MN_STOP irp, in response of this IRP driver should just stop the device and freed all the hardware resources. In this case pnp manager just modifies the stat of driver but driver remains loaded.
However in response of uninstall driver will be getting IRP_MN_REMOVE irp first then pnp manager will be calling driver unload entry point.

Dev
-----Original Message-----
From: Tomer Goldberg [mailto:tomerg22@012.net.il]
Sent: Friday, November 19, 2004 7:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] difference between disable and uninstall driver

Hi
Regarding a WDM driver on 2k/XP,
is there any difference between disable and uninstall in
the pnp manager from the drivers point of view?

do the DriverUnload function gets called in both cases?

thanks,
Tomer Goldberg

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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

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

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