Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 23, 2012 05:41
Show Gist options
  • Save sandrinodimattia/3162093 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3162093 to your computer and use it in GitHub Desktop.
Windows Firewall (COM)
[ComImport, ComVisible(false), Guid("F7898AF5-CAC4-4632-A2EC-DA06E5111AF2"), System.Runtime.InteropServices.InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface INetFwMgr
{
INetFwPolicy LocalPolicy { get; }
FirewallProfileType CurrentProfileType { get; }
void RestoreDefaults();
void IsPortAllowed(string imageFileName, IPVersion ipVersion, long portNumber, string localAddress, IPProtocol ipProtocol, [Out] out bool allowed, [Out] out bool restricted);
void IsIcmpTypeAllowed(IPVersion ipVersion, string localAddress, byte type, [Out] out bool allowed, [Out] out bool restricted);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment