Share via


FirewallEnableRule

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This function enables or disables a firewall rule.

Syntax

DWORD FirewallEnableRule(
  HRULE hRule, 
  BOOL bEnabled, 
  BOOL bPersist
);

Parameters

  • hRule
    [in] Handle to the rule to enable or disable.
  • bEnabled
    [in] TRUE to enable the rule, and FALSE otherwise.
  • bPersist
    [in] TRUE to save the setting in the registry so that it preserved when a reboot occurs, or FALSE otherwise.

Return Value

Returns ERROR_SUCCESS if operation succeeds.

Requirements

Header fwapi.h
Library fwapi.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

IP Firewall Functions
HRULE

Other Resources

System Errors - Alphabetical Order