:Start of vdsfirewall vdsfirewall.dsc
DragonSphereSoftware

DragonSphere Software Demos


If you are viewing this script in your browser you can save it as a VDS 5.x source file (*.dsc) to run it.




#
# DragonSphere Software's Home Page
#  
# All Source Files for this demo including ipfwlite.zip
#
# This demo uses the IPFWLite ActiveX control TIPFWLite.dll which is no longer being developed
# or supported by the original author: Egemen Tas, modemwall.com
#
#
# To install and use the Firewall control please see the install.txt file found in ipfwlite.zip file
#

If @Greater(@Name(@SYSINFO(DSVER)),4)

External @Path(%0)gadgetx.dll,5.0

  #DEFINE COMMAND,GADGETX,OLE,DEFINE,SET,CALL
  #DEFINE FUNCTION,GADGETX,OLE,GET,CALL
  #DEFINE COMMAND,ONLOG
  #DEFINE COMMAND,ONERROR
Else
  Warn This demo is desinged for VDS 5.x
  Exit
End
Ole Init


%%StartFirewall = @Path(%0)sample_lite.policy

Define Variable,Object,TIPFWLITELib
Define GUID,TIPFirewallEvents,{4DAB9BB3-F312-4220-B901-B916D9FCDDAB}

Set TIPFWLITELib,@Ole(Create,TIPFWLite.TIPFirewall.1,NULL)


  DIALOG CREATE,VDS FireWall,-1,0,499,409
# *** Modified by Dialog Designer on 5/27/2005 - 12:09 ***
  DIALOG ADD,MENU,&File,Start,Stop,-,Save FireWall Log,Save Error Log,-,E&xit
  DIALOG ADD,TEXT,TEXT1,10,30,,,This is a simple FireWall demo that uses the TIPFWLite FireWall control.@CR()This is a demo that shows how you can use VDS and Gadget to access@CR()an ActiveX control that communicates with a windows driver.
  DIALOG ADD,TEXT,FireWall_txt,63,38,,,FireWall Log
  DIALOG ADD,LIST,FireWall_lst,81,37,442,150
  DIALOG ADD,TEXT,Error_txt,236,41,,,Error Log
  DIALOG ADD,LIST,Error_lst,252,37,442,94
  DIALOG ADD,BUTTON,Start,356,135,64,24,Start
  DIALOG ADD,BUTTON,Stop,356,301,64,24,Stop
  DIALOG ADD,STATUS,STATUS1
  DIALOG SHOW
Define EventMap,TIPFirewallEvents,OnLog,1
Define EventMap,TIPFirewallEvents,OnError,2
%%token = @Ole(ConnectEvents,TIPFWLITELib,TIPFirewallEvents)
%%Stopped = 0
:evloop
  Wait Event
  %E = @Event()
  If %E
    Goto %E
  End
goto evloop
:EXITMENU
:CLOSE
  If @Zero(%%Stopped)
    Ole Call,TIPFWLITELib,"StopFirewall"
    Dialog Set,STATUS1,VDS Firewall Stopped
  End
  Ole DisConnectEvents,TIPFWLITELib,TIPFirewallEvents,%%token
  Ole Free,object,TIPFWLITELib
  Ole UnInit
Exit
:STARTMENU
:STARTBUTTON
  Ole Call,TIPFWLITELib,"StartFirewall(^B)",%%StartFirewall
  Dialog Set,STATUS1,VDS Firewall Started
  %%Stopped = 0
goto evloop
:STOPMENU
:STOPBUTTON
  If @Zero(%%Stopped)
    Ole Call,TIPFWLITELib,"StopFirewall"
    Dialog Set,STATUS1,VDS Firewall Stopped
    %%Stopped = 1
  End
goto evloop
:Save FireWall LogMENU

goto evloop
:Save Error LogMENU
  
goto evloop
:TIPFirewallEventsOnError
  %%ErrTxt = @Ole(EventParamsList,TIPFirewallEventsOnError)
  List Append,Error_lst,%%ErrTxt
  Dialog Set,Status1,%%ErrTxt
goto evloop
:TIPFirewallEventsOnLog
  %%LogTxt = @Ole(EventParamsList,TIPFirewallEventsOnLog)
  List Append,FireWall_lst,%%LogTxt
goto evloop
:End of vdsfirewall