Of course no program should be able to add itself but are the firewall rules readable by non-privileged applications? I have an application which needs to be added to the rules for a special operation. Rather than failing silently or timing out, I'd like the application to proactively prompt the user, "I need access to port xxx and I'm not listed in your firewall rules. Please go HERE and do THIS so that I can work for you."
Asked
Active
Viewed 112 times
1 Answers
1
Yes. The firewall rules are stored in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\FirewallRules registry key. While in theory you could query the key values directly, it's better to use the Windows Firewall API functions:
- Windows Firewall for Windows XP with SP2 API Reference
- Using Windows Firewall with Advanced Security (Windows Vista and later)
and31415
- 14,610