Hi everyone,
I have an extra device object I created base on IOCTL example, and I
have it set to remove itself once it has been closed by the user app.
(It’s a Upper filter and removes the “communication” device after all
audio instances (e.g. USB Headphones) are remove) .
I noticed that even when the driver hasn’t any devices attached/loaded
it is still remaining in memory. If I remove the communication device
(IOCTL) from the last usb headphone being remove, the driver will
unload, but if I remove the device not in RemoveDevice() from the
DispatchPNP() , but from the Close event for the IOCTL, it will not
unload the driver.
So is there a way to ask windows to “unload me”?
Cheers
Obble.
No, there is no way. You must delete the control devobj in the remove handler for your pnp object. It is ok to delete a devobj that still has an open handle against it, the handle keeps an Ob ref on the devobj.
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: NCH Obble Smith
Sent: Wednesday, November 04, 2009 6:15 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Automatic Unloading
Hi everyone,
I have an extra device object I created base on IOCTL example, and I
have it set to remove itself once it has been closed by the user app.
(It’s a Upper filter and removes the “communication” device after all
audio instances (e.g. USB Headphones) are remove) .
I noticed that even when the driver hasn’t any devices attached/loaded
it is still remaining in memory. If I remove the communication device
(IOCTL) from the last usb headphone being remove, the driver will
unload, but if I remove the device not in RemoveDevice() from the
DispatchPNP() , but from the Close event for the IOCTL, it will not
unload the driver.
So is there a way to ask windows to “unload me”?
Cheers
Obble.
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Thank you Doron.
On 5/11/2009 2:16 PM, Doron Holan wrote:
No, there is no way. You must delete the control devobj in the remove handler for your pnp object. It is ok to delete a devobj that still has an open handle against it, the handle keeps an Ob ref on the devobj.
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: NCH Obble Smith
> Sent: Wednesday, November 04, 2009 6:15 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Automatic Unloading
>
>
> Hi everyone,
>
> I have an extra device object I created base on IOCTL example, and I
> have it set to remove itself once it has been closed by the user app.
> (It’s a Upper filter and removes the “communication” device after all
> audio instances (e.g. USB Headphones) are remove) .
>
> I noticed that even when the driver hasn’t any devices attached/loaded
> it is still remaining in memory. If I remove the communication device
> (IOCTL) from the last usb headphone being remove, the driver will
> unload, but if I remove the device not in RemoveDevice() from the
> DispatchPNP() , but from the Close event for the IOCTL, it will not
> unload the driver.
>
> So is there a way to ask windows to “unload me”?
>
> Cheers
> Obble.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
Doron Holan wrote:
No, there is no way.
Didn’t someone suggest an unload procedure for a driver that’s been orphaned by a non-PNP control device? That is, bring up a root-enumerated instance of the driver and then bring it down again?
Fine, there is a weird way that is not intended to do this that has a nice side effect. If he were to have a root enumerated device, stop having a control devobj altogether and just use the root device as your sideband communication channel
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@gmail.com
Sent: Friday, November 06, 2009 8:28 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Automatic Unloading
Doron Holan wrote:
> No, there is no way.
Didn’t someone suggest an unload procedure for a driver that’s been orphaned by a non-PNP control device? That is, bring up a root-enumerated instance of the driver and then bring it down again?
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
That procedure works fine (I may have even been the suggestor). It is how
we get NDIS IM drivers out of memory that have a ‘control’ channel device
which is permitted to be held open even when the last binding is removed.
Works as well for any NDIS Minport Driver that might be, for instance,
exporting a global control device object that is permitted to live ‘longer’
than the Miniport Adapter instances.
Now it might just be coincidence that it works…
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, November 06, 2009 11:27 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Automatic Unloading
Doron Holan wrote:
No, there is no way.
Didn’t someone suggest an unload procedure for a driver that’s been orphaned
by a non-PNP control device? That is, bring up a root-enumerated instance
of the driver and then bring it down again?
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer