How to get number of Rules and details of rule using WFP API ( like the old INetFwPolicy2 COM based APIs )
Using - INetFwPolicy2 , INetFwRules, INetFwRule , and associated COM based ( old style firewall API ) I can see all the rules like ---
Name: Windows Collaboration Computer Name Registration Service (SSDP-Out)
Description: Outbound rule for the Windows Collaboration Computer Name Registration Service to allow use of the Simple Service Discovery Protocol. [UDP 1900]
Application Name: C:\WINDOWS\system32\svchost.exe
Service Name: Ssdpsrv
IP Protocol: UDP
Local Ports: *
Remote Ports: 1900
LocalAddresses: *
RemoteAddresses: LocalSubnet
Profile: Domain
Profile: Private
Profile: Public
Direction: Out
Action: Allow
Interface Types: All
On my machine the number of rules is 531, and each one is a rule.
How can I get a similar output using WFP API ??
Using WFP API, enumerate over all the Filters, I get 337 such Filters ( Basically number of Rules using old FW API, and number of Filters does not match using WFP ).
result = FwpmFilterCreateEnumHandle0(
engine,
NULL, // &enumTempl( result is 1783,
&enumHandle
);
EXIT_ON_ERROR(FwpmFilterCreateEnumHandle0);
result = FwpmFilterEnum0(
engine,
enumHandle,
INFINITE,
filters,
numFilters
);
EXIT_ON_ERROR(FwpmFilterEnum0);
So is there a way to get the old style information using WFP API ?? If not, then can I use the old type COM based API for some specific routines of my module ?
Thanks,
Prokash