The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I'm building a minifilter driver for windows 10 which uses stream contexts.
I noticed that most of my stream contexts are not freed until driver unload, or only after a few very long hours.
I'm releasing all of my references to the context, and everything seems to work fine in my end.
The IRP_MJ_CLEANUP callback is called, but the IRP_MJ_CLOSE is not called for every file object. I usually have 1/2 file objects not getting to IRP_MJ_CLOSE at a reasonable time.
I've read some posts here and I understand the reason for this is unreleased references to the stream by the cache manager or the memory manager.
I tried to purge the cache in cleanup (CcFlushCache, MmFlushImageSection, CcPurgeCacheSection), and it works most of the time, but I'm looking for a better solution, maybe one that does not involve messing with the CC/MM??
My stream context is pretty big in size (few KBs), and at some point it turns into a pretty big chunk of memory...
The question is: Is there a way to rush the freeing of stream contexts?
I don't want to wait hours for it to be released by the OS.
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Internals & Software Drivers||25 Jan 2021||LIVE ONLINE|
|Developing Minifilters||8 March 2021||LIVE ONLINE|