Windows Firewall Control (WFC) by BiniSoft.org

Discussion in 'other firewalls' started by alexandrud, May 20, 2013.

  1. yoweho8574

    yoweho8574 Registered Member

    Joined:
    Mar 11, 2020
    Posts:
    19
    Location:
    UK
    hi thanks for replying, maybe i made it not clear, those rules in red text are valid, it's just that when wfc.exe do not have the read privileges on the files then he detect them as missing and so you can't edit the rules because the apply button is greyed out and you need to disable Secure Profile in WFC and use the official Windows Firewall UI to edit them instead of using WFC.
     
    Last edited: Jun 19, 2020
  2. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    Can you post a screenshot of such rules that appear in red while they are valid? Are they created for locations from mounted drives ? Or what is different about these paths ?
     
  3. aldist

    aldist Registered Member

    Joined:
    Nov 8, 2017
    Posts:
    1,114
    Location:
    Lunar module
    Is this really so? I have disabled this service for a long time, but I do not see any problems with notifications. Or in the same way, using Simple DNScrypt instead of DNS Client service (DNSCache) does not create problems with notifications.
     
  4. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    Most users will not use a custom DNS. In your case you are using an alternative that is resolving the IP address of a host from the host's name, but without it, if you disable DNS Client service then all blocked connections are using local IP addresses from your local network instead of actual IP addresses.
     
  5. yoweho8574

    yoweho8574 Registered Member

    Joined:
    Mar 11, 2020
    Posts:
    19
    Location:
    UK
    it's just that when an app is located in another user profile or in a folder which the wfc ui user do not have read rights then the rule is in red text because WFC detect them as missing and so you can't edit it and you have to disable secure profile and use the official windows firewall rules panel to edit it if you want to.
     
    Last edited: Jun 20, 2020
  6. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,559
    Location:
    The Netherlands
  7. Special

    Special Registered Member

    Joined:
    Mar 23, 2016
    Posts:
    454
    Location:
    .
    No, why would they be removed?
     
  8. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    Now I understand. I will fix this in the next WFC version. Thank you for reporting this.
    It depends. Before re-enabling Secure Rules make sure you create an authorized group name for the rules that were added recently in a new group. If they are added without a group name, WFC will ask you if you want to add these rules without a group name to Windows Firewall Control group name so that they will not be disabled/removed.
     
  9. lahma

    lahma Registered Member

    Joined:
    Jun 21, 2020
    Posts:
    4
    Location:
    USA
    After reading through the last few pages, I'm aware that other users are also experiencing the same issue, but I thought I would go ahead and report the issue as well. After manually updating to Windows 10 2004 (Build 19041), I am no longer able to open the properties window for any rules in WFC. Looking at Event Viewer, it appears that the very first exception that occurred as a result of trying to open a properties window (after updating to Windows 10 2004) is different from all of the subsequent exceptions (that occur when trying to open a properties window). Perhaps this might be helpful in diagnosing what the problem is? Additionally, if it would be helpful, I can attach a debugger to the process using dnSpy to gain further info (I'm a .NET dev myself) to help try to resolve the problem. Just let me know!

    Windows 10 Enterprise x64 en-US (US, English)
    Current Windows 10 Version: 2004 (Build 19041)
    Previous Windows 10 Version (prior to updating): 1903 (Build 18362)

    1st exception logged in event viewer when trying to open a rule's properties window (after updating to Windows 10 2004):
    Code:
    System.Windows.Threading.DispatcherUnhandledExceptionEventArgs was caught.
    Exception: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at WindowsFirewallControl.Views.PropertiesView..ctor(RuleData ruleData, ViewPurpose viewPurpose) at WindowsFirewallControl.Common.ViewManager.OpenProperties(RuleData ruleData, ViewPurpose viewPurpose) at WindowsFirewallControl.ViewModels.RulesPanelViewModel.ExecuteModifyRuleCommand(Object obj) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Controls.Control.HandleDoubleClick(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

    2nd exception logged in event viewer when trying to open a rule's properties window (after updating to Windows 10 2004):
    Code:
    System.Windows.Threading.DispatcherUnhandledExceptionEventArgs was caught.
    Exception: System.NullReferenceException: Object reference not set to an instance of an object. at WindowsFirewallControl.Common.ViewManager.OpenProperties(RuleData ruleData, ViewPurpose viewPurpose) at WindowsFirewallControl.ViewModels.RulesPanelViewModel.ExecuteModifyRuleCommand(Object obj) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Controls.Control.HandleDoubleClick(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    4th exception logged in event viewer when trying to open a rule's properties window (after updating to Windows 10 2004):
    Code:
    System.Windows.Threading.DispatcherUnhandledExceptionEventArgs was caught.
    Exception: System.NullReferenceException: Object reference not set to an instance of an object. at WindowsFirewallControl.Common.ViewManager.OpenProperties(RuleData ruleData, ViewPurpose viewPurpose) at WindowsFirewallControl.ViewModels.RulesPanelViewModel.ExecuteModifyRuleCommand(Object obj) at WindowsFirewallControl.Common.DelegateCommand`1.Execute(Object parameter) at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated) at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
     
  10. Alpengreis

    Alpengreis Registered Member

    Joined:
    Oct 7, 2013
    Posts:
    673
    Location:
    Switzerland
    @lahma

    First, thank you for your effort to report that! That seems really a difficult thing to resolve ...

    And indeed, I see (some) new infos in your exceptions compared to the already reported.

    Last but not least, if you could really debug this it would be highly probably REALLY usefully, because Alexandru (the developer) can't reproduce it till now.

    Once again, thank you!
     
  11. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,559
    Location:
    The Netherlands
    OK thanks for the feedback.
     
  12. lahma

    lahma Registered Member

    Joined:
    Jun 21, 2020
    Posts:
    4
    Location:
    USA
    Sure, I'd be happy to help out in whatever way I can. While I'm sure it wouldn't be difficult to figure out on my own, if @alexandrud could tell me which assembly the rules window resides within, that would make things a bit quicker/easier.
     
  13. Alpengreis

    Alpengreis Registered Member

    Joined:
    Oct 7, 2013
    Posts:
    673
    Location:
    Switzerland
    @lahma Yes, sure - that would make it certainly easier. I am sure he will answering soon!
     
  14. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    The assembly is wfc.exe and the view is located under Views\PropertiesView.xaml

    If someone is willing to help with this, since I can't reproduce it, below is a possible way.

    There is this tool:
    https://docs.microsoft.com/en-us/sysinternals/downloads/disk2vhd
    which can convert a system drive to a VHD (Virtual Hard Disk).

    1. If you have time, please download and use this tool to convert your C:\ drive to a VHD file.
    2. You can mount this drive in Windows 10 and remove any personal file from it. I just need the combination of system files and updates that are on this particular machine.
    3. You can share this file with me so that I can have access to a machine state/config that has this problem (Properties dialog not working). This is a result of many factors which I can't reproduce.
    4. I can download this VHD file and mount in Hyper-V on my side and test in debug mode, after I install Visual Studio on it to see what is going on.
    5. If I replicate the problem, which I hope to, then I can provide a fix.

    This means, someone who has this problem is willing to do all these steps. If you agree to do this, please send me a private message.
     
    Last edited: Jun 22, 2020
  15. lahma

    lahma Registered Member

    Joined:
    Jun 21, 2020
    Posts:
    4
    Location:
    USA
    In all likelihood, I'm probably just completely blind, but I could not figure out how to send you a PM. Perhaps it is because I'm a new user on the forum? If you could either send me a PM or help alleviate my ignorance on how to send you a PM, I'd be happy to discuss the issue with you.

    Since I have plenty of experience creating VHD images, doing so wouldn't be a technical problem, but being that the problem is occurring on my personal machine, it would require a lot of time and effort to remove all of my personal files (a lot of my stuff is stored outside of my Windows profile so it wouldn't be as simple as just deleting my user account) and strip the VHD down to a reasonable size. Being that I already have Visual Studio 2017/2019 installed, it would probably be easier to just create a temporary user profile and give you remote access either via RDP (although it sits behind my VPN server) or TeamViewer. I suspect that probably is not a viable option for you however since I'm sure you do not (or legally cannot) want to send the source code to some random remote in order to debug it.

    I'm going to attach dnSpy to WFC right now and see if I can't spot anything obvious whenever the exception is being thrown. Just shoot me a PM whenever is convenient for you and I'll let you know what I find out.
     
  16. aldist

    aldist Registered Member

    Joined:
    Nov 8, 2017
    Posts:
    1,114
    Location:
    Lunar module
    ScreenShot_248.png
     
  17. guest

    guest Guest

    A few more posts are needed to be able to send PM's.
     
  18. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    Providing the source code is not an option since I do not own it anymore. If you are using dnSpy you can put a break point at line 172 in method OpenProperties located in this file Common/ViewManager.cs in the same wfc.exe. Thank you for giving it a try, taking into consideration the limitations.
     
  19. stapp

    stapp Global Moderator

    Joined:
    Jan 12, 2006
    Posts:
    24,068
    Location:
    UK
    @lahma
    You should be able to use the pm's/conversations now.
     
  20. lahma

    lahma Registered Member

    Joined:
    Jun 21, 2020
    Posts:
    4
    Location:
    USA
    Thank you!
     
  21. alexandrud

    alexandrud Developer

    Joined:
    Apr 14, 2011
    Posts:
    2,436
    Location:
    Romania
    Windows Firewall Control v.6.2.0.0

    I was finally able to fix the problem with the Properties dialog that did not work anymore thanks to @Alpengreis who helped me with info and testing. Thank you.

    Change log:

    - Improved: Remote addresses content is now expanding to fill the available space in Properties dialog so that more content can be displayed.
    - Fixed: Properties dialog is not displayed anymore if two or more Windows services have the same Display Name.
    - Fixed: The service name for svchost.exe notifications is detected only for the Windows services that are already running when WFC service starts. If a Windows service is started after, the notification will not detect the Windows service that triggered the notification.
    - Fixed: Unhandled exception is logged if certain files are missing from the installation folder.
    - Fixed: When editing a rule details in the Notification dialog, the rule name can be set as one or several empty spaces.
    - Fixed: Properties dialog can't apply changes to a rule if the path of the rule is not accessible or not found. This limitation was removed. Also the tooltip was updated since a rule with red text does not always mean the file is not found, it can also mean the file is not accessible (file located in a folder of another user account, encrypted location, etc).
    - Fixed: In Notification dialog the text (Yes, No, Not valid) under Signed property is not localized.
    - Removed: The X button from text boxes that is clearing their content.

    New translation string
    860 = Not valid

    Modified translation string
    936 = The program path of this rule is not accessible or does not exist


    Download location: https://www.binisoft.org/download/wfc6setup.exe
    SHA1: 5ca1f7de457151ebfbcf2d60cac43064694d912e
    SHA256: 0482e91c62a4063af5354e399320fd86a500913d2eec820d8900da38df5a56c0

    Looking forward to read your feedback,
    Alexandru

    WFC is working again and updated :)
     
  22. Alpengreis

    Alpengreis Registered Member

    Joined:
    Oct 7, 2013
    Posts:
    673
    Location:
    Switzerland
    @alexandrud

    Thank you so much! You are always here for us users and you never let us down! I appreciate that much, REALLY! :thumb::thumb::thumb:

    PS: German translation is ready soon ...
     
  23. Alpengreis

    Alpengreis Registered Member

    Joined:
    Oct 7, 2013
    Posts:
    673
    Location:
    Switzerland
    For the users of the german language version:

    The newest german translation file for v6.2.0.0 is done and sent already to the developer. It should be available very soon ...
     
    Last edited: Jun 24, 2020
  24. aldist

    aldist Registered Member

    Joined:
    Nov 8, 2017
    Posts:
    1,114
    Location:
    Lunar module
    Thanks for the new version, a lot of useful and correct changes, it works well :thumb: In my opinion, there is one :thumbd: - the X button was in vain removed from the Properties, it was useful and very often used, sad without her :doubt:
    1.png
    Please do as it was yesterday! :)
     
  25. Alpengreis

    Alpengreis Registered Member

    Joined:
    Oct 7, 2013
    Posts:
    673
    Location:
    Switzerland
    Or as configurable option, so the user could choose ...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.