locked
Simple filtering of http traffic using WFP and C# - is it possible? RRS feed

  • Question

  • Is it possible to filter http requests using WFP and C#?

    I'd like something that runs in the background and blocks all URLs with a specific string in it.

    Would one approach be to write managed C++ wrappers for the user mode APIs of WFP? If so, how close to the above ideal would this get me? Would it be difficult to do this? Is that the approach taken in this code?

    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/a65bf197-937b-401e-b15f-0e1c3decdb14/windows-filtering-platform-and-net?forum=wfp

    Thanks in advance for any help at all. I had hoped that this would be easy, but it doesn't look this way.

    • Edited by CSharpLearner2 Wednesday, June 4, 2014 8:39 PM Added additional link
    Wednesday, June 4, 2014 8:37 PM

All replies

  • This will require a kernel mode WFP callout to parse out the string.  C# is not supported in the kernel.

    Hope this helps,


    Dusty Harper [MSFT]
    Microsoft Corporation
    ------------------------------------------------------------
    This posting is provided "AS IS", with NO warranties and confers NO rights
    ------------------------------------------------------------

    Thursday, June 5, 2014 5:37 PM
    Moderator