Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
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 am writing a WFP driver to perform deep inspection at the Stream layer.
A context is associated at ALE_CONNECT (Connect layer) using FwpsFlowAssociateContext.
There is a specific need to associate a context in the Connect layer.
However for FlowEstablishedClassify or StreamClassify callouts, WFP passes the flowContext as 0.
Hence I am not able to dereference my context and perform the deep inspection at the stream layer.
Please let me know if there is anything I am missing here.
When the flow gets closed WFP calls AleConnectFlowDeleteFn() with the correct context which wad allocated during AleConnectClassify()
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 |
Comments
What parameters are you passing to these functions, what are they returning?
thanks for your response, I saw this response just now.. The issue was that I was passing a wrong calloutID and layerID. It started working correctly after passing callout and streamID. I have another issue now - and this is when FwpsFlowRemoveContext returns STATUS_UNSUCCESSFUL (There is no context currently associated with the data flow.) for existing flows and hence the callout can't be unregistered.
there is a similar issue reported but with no reply from MS. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3d7e45ee-d3dd-49cf-8599-743cdac76097/fwpsflowremovecontext-returns-statusunsuccessful?forum=wfp
Just an update - the issue reported in the above URL when a context is associated at ALE_CONNECT layer is a definite MS WFP bug. The driver cannot be unloaded in this case, the code works perfectly well when the context is attached at FLOW_ESTABLISHED layer.