Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results


More Info on Driver Writing and Debugging

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:

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

Accessing PFLT_INSTANCE Instance from DriverEntry()

benjibenji Member Posts: 10


While my minifilter is living it allocates some structures with FltAllocatePoolAlignedWithTag().
Then when it dies I would like to clean them up.
But how can I retrieve a PFLT_INSTANCE from my _FLT_REGISTRATION.PFLT_FILTER_UNLOAD_CALLBACK routine in order to call FltFreePoolAlignedWithTag?
I could record this PFLT_INSTANCE in a global variable may be, but is there a nicer way to do it?

Thank you.


  • rod_widdowsonrod_widdowson Member - All Emails Posts: 1,188

    Less that a minute of googling got me FltEnumerateVolumes and FltEnumerateInstances but why not either keep them in a list that you manage (insert in your create callback and remove in your free callback).

    You also need to be aware that when you call FltTearDownFiltering(or whatever it is called), all your instances will be called at their detach entry point.

  • benjibenji Member Posts: 10

    Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 2 August 2021 Live, Online
Kernel Debugging 27 Sept 2021 Live, Online