Hi,
Is there a situation where I can get the drivers unload routine
called without a prior call with MN_REMOVE_DEVICE?
Should I take care of returning the resources, deleting device, etc.
in the case of MN_REMOVE_DEVICE and the unload routine,
or is it enough and correct to do it only in case of MN_REMOVE_DEVICE.
thanks,
Tomer Goldberg
You should not receive the unload without first having all of your pnp
devices removed. Per device resources are released on device remove, global
resources are removed on unload.
Note that if you have a control device you might want to remove that device
when your last pnp device is removed.
For legacy drivers (non-pnp) unload can be invoked from the system service
control API. If I recall correctly, this unload, rather than the automatic
pnp manager initiated unload, will be sent to a driver that has legacy
non-pnp device objects associated with it.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tomer Goldberg
Sent: Tuesday, November 30, 2004 6:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DriverUnload vs MN_REMOVE_DEVICE
Hi,
Is there a situation where I can get the drivers unload routine
called without a prior call with MN_REMOVE_DEVICE?
Should I take care of returning the resources, deleting device, etc.
in the case of MN_REMOVE_DEVICE and the unload routine,
or is it enough and correct to do it only in case of MN_REMOVE_DEVICE.
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 can happen if you fail AddDevice or don't actually attach a device
object during AddDevice (or if you're not a PNP driver at alll, but i'll
presume you weren't talking about that case).
Once you've attached to a stack & told PNP that you've done so (by
returning success from AddDevice) you'll get an IRP_MN_REMOVE_DEVICE for
each attached device before your Unload routine is called.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tomer Goldberg
Sent: Tuesday, November 30, 2004 3:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DriverUnload vs MN_REMOVE_DEVICE
Hi,
Is there a situation where I can get the drivers unload routine
called without a prior call with MN_REMOVE_DEVICE?
Should I take care of returning the resources, deleting device, etc.
in the case of MN_REMOVE_DEVICE and the unload routine,
or is it enough and correct to do it only in case of MN_REMOVE_DEVICE.
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
MN_REMOVE_DEVICE deletes the PnP device object only, the one for which it is called.
Deletion of the global data (if required) and IoDeleteDevice for all non-PnP device objects created by the driver must be done in Unload.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
----- Original Message -----
From: Tomer Goldberg
To: Windows System Software Devs Interest List
Sent: Tuesday, November 30, 2004 2:53 PM
Subject: [ntdev] DriverUnload vs MN_REMOVE_DEVICE
Hi,
Is there a situation where I can get the drivers unload routine
called without a prior call with MN_REMOVE_DEVICE?
Should I take care of returning the resources, deleting device, etc.
in the case of MN_REMOVE_DEVICE and the unload routine,
or is it enough and correct to do it only in case of MN_REMOVE_DEVICE.
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