locked
FWPM_SUBLAYER_FLAG_PERSISTENT cause FWP_E_DYNAMIC_SESSION_IN_PROGRESS only in Win7 RRS feed

  • Question

  • Calling FwpmSubLayerAdd0 with FWPM_SUBLAYER_FLAG_PERSISTENT flag works on Windows 10,

    but return a FWP_E_DYNAMIC_SESSION_IN_PROGRESS error on Windows 7 (and probably below versions).

    Any advice about any docs link? Thanks.

    Monday, July 18, 2016 2:47 PM

Answers

  • This is the same as adding a provider, in Windows 7 it cannot be added as part of a dynamic session. We worked around this by adding it in a seperate, non dynamic session.
    • Proposed as answer by JST86 Friday, July 22, 2016 4:13 PM
    • Marked as answer by Clodo76 Saturday, July 23, 2016 2:52 PM
    Friday, July 22, 2016 4:13 PM

All replies


  • I create a minimal console C++ project (with VS2015).
    https://www.clodo.it/files/varie/TestWfp.zip

    main.cpp code: http://pastebin.com/ubqsm1qZ

    Under Windows 10:

    S:\temp\TestWfp\Release>TestWfp.exe
    FwpmEngineOpen0:                    0
    FwpmSubLayerAdd0:                    0



    Under Windows 7 (6.1 Build 7601: Service Pack 1)

    S:\temp\TestWfp\Release>TestWfp.exe
    FwpmEngineOpen0:                    0
    FwpmSubLayerAdd0:                    8032000b

    0x8032000B = FWP_E_DYNAMIC_SESSION_IN_PROGRESS - The call is not allowed from within a dynamic session.

    I don't find any info if is a compatibility issue or a bug in my code. Still looking about how i can create a permanent filter that survive if the process end, that works on Windows Vista/7.

    Thanks for any advice.

    Thursday, July 21, 2016 7:12 PM
  • This is the same as adding a provider, in Windows 7 it cannot be added as part of a dynamic session. We worked around this by adding it in a seperate, non dynamic session.
    • Proposed as answer by JST86 Friday, July 22, 2016 4:13 PM
    • Marked as answer by Clodo76 Saturday, July 23, 2016 2:52 PM
    Friday, July 22, 2016 4:13 PM
  • Ok, i understand, issue closed. Thanks JST86.

    Using FWPM_SESSION_FLAG_DYNAMIC with FWPM_SUBLAYER_FLAG_PERSISTENT throw an error under Win7 and below, not under Win8.1 and above.  I still think that MSDN docs need to inform about this.

    Saturday, July 23, 2016 2:55 PM