CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    India
    Posts
    62

    Question Urgent: changing firewall settings programmatically

    hi

    Wix XP SP2 brings new window's firewall and turns it on automatically. It blocks all the ports (which are not in common use like 80 and 21) and unsolicited traffic.

    My software is wokring on some different port and connets to the serveral computer over the local network as well to the web server. So if either the source machine or the destination machine is XP SP2 it prompts the user for allowing the traffic.

    I dont want this dialog box. In some cases software is required to do the work silently without any user interaction. But this XP SP2 denys to do so.

    In the tech articles its mentioned that one can add the name of the application or the port it is using in the exception list which firewall ingnores during the traffic control if the the "Dont' Allow Exception" on the General tab is not checked.

    So now I want to add my application name programmatically in this exception list. And when my work is over I would like to delete it from the list.

    Can some one tell me the APIs to achieve this?
    Last edited by vksanghavi; June 22nd, 2004 at 02:29 AM.
    Vaibhav...

  2. #2
    Join Date
    Aug 2002
    Location
    India
    Posts
    62

    Changing firewall settings programmatically for XP SP2

    Actually the scenario is some thing like this...

    A user will run my software to migrate some settings of his PC to the other PC he has. He will be the Adminstrator for the destination PC. Software pushes some destination agent to accomplish the work. The destination agent runs on the destination machine and migrates the necessary settings.

    Again let me tell you that the user context in which this agent will run on the destination machine would be the Administrator of that destination machine. And I belive an adminstrator can change the firewall settings programmatically also.

    I dont want the user to go explicitely on the remote destination machine and set the firewall settings.

    I guess now the problem is pretty clear.. any solution ?
    Last edited by vksanghavi; June 22nd, 2004 at 02:30 AM.
    Vaibhav...

  3. #3
    Join Date
    Jun 2002
    Location
    Madrid - Spain
    Posts
    28

    Re: Urgent: changing proxy settings programmatically

    You can have a look on this code by Youngjin Kim. I found it very useful to manage WinXP Firewall:

    http://www.codeproject.com/w2k/WinXPSP2Firewall.asp

    Best greetings,

    Ricardo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured