enable/disable firewall xp/sp2
Verfasst: 25.10.2005 09:29
Code: Alles auswählen
;enable/disable firewall xp/sp2
Interface INetFwProfile Extends IDispatch
get_Type(a)
get_FirewallEnabled(a)
put_FirewallEnabled(a)
get_ExceptionsNotAllowed(a)
put_ExceptionsNotAllowed(a)
get_NotificationsDisabled(a)
put_NotificationsDisabled(a)
get_UnicastResponsesToMulticastBroadcastDisabled(a)
put_UnicastResponsesToMulticastBroadcastDisabled(a)
get_RemoteAdminSettings(a)
get_IcmpSettings(a)
get_GloballyOpenPorts(a)
get_Services(a)
get_AuthorizedApplications(a)
EndInterface
Interface INetFwPolicy Extends IDispatch
get_CurrentProfile(a)
GetProfileByType(a,b)
EndInterface
Interface INetFwMgr Extends IDispatch
get_LocalPolicy(a)
get_CurrentProfileType(a)
RestoreDefaults()
IsPortAllowed(a,b,c,d,e,f,g)
IsIcmpTypeAllowed(a,b,c,d,e)
EndInterface
CoInitialize_(0)
If CoCreateInstance_(?CLSID_NetFwMgr,0,1,?IID_INetFwMgr,@object0.INetFwMgr) = 0
object0\get_LocalPolicy(@a.INetFwPolicy)
a\get_CurrentProfile(@objPolicy.INetFwProfile)
;ausschalten
objPolicy\put_FirewallEnabled(#False)
objPolicy\get_FirewallEnabled(@fwout.l)
Debug fwout
;einschalten
objPolicy\put_FirewallEnabled(#True)
objPolicy\get_FirewallEnabled(@fwout.l)
Debug fwout
EndIf
CoUninitialize_()
DataSection
CLSID_NetFwMgr:
Data.l $304CE942
Data.w $6E39,$40D8
Data.b $94,$3A,$B9,$13,$C4,$0C,$9C,$D4
IID_INetFwMgr:
Data.l $F7898AF5
Data.w $CAC4,$4632
Data.b $A2,$EC,$DA,$06,$E5,$11,$1A,$F2
EndDataSection
