Programmatically Configuring the Windows XP Firewall

G

Guest

I have a C++ Windows Service that needs to add itself to the Exceptions List
of the Win XP SP2 firewall.

When the service starts it simply stuffs this key -

C:\<Path to app>\<AppName>.exe

and this value -

C:\<Path to app>\<AppName>.exe:*:Enabled:<AppName>

into -

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List

and

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\AuthorizedApplications\List

The issue is this -

It only seems to work on a few computers (all running the same build of XP)
- on those computers where it doesn't work our app doesn't show up in the
list of Exceptions in the firewall configuration.

I've tried manually adding my app to the Exceptions list in firewall config
and it suddenly starts working. I've WinDiff'd registry snapshots before I
manually configure the firewall and after I make the manual change and there
are no differences??

Any ideas?

Cheers.
 
S

Steven L Umbach

You might try using the netsh firewall command as shown in the link below.
Keep in mind however that if Group Policy applies to any computers that the
"manual" changes will be overridden at the next Group Policy forced refresh
or when the Group Policy is updated or refreshed if registry changes are
reapplied at every GP refresh. --- Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top