Share via


FirewallEnable

This function enables or disables the firewall. The initial state of the firewall, after the device boots, depends on registry settings.

DWORD FirewallEnable(
  USHORT Family,
  BOOL bEnable, 
  BOOL bPersist
);

Parameters

  • Family
    [in] Indicates the family to which the firewall is enabled. The following table shows the possible values.

    Value Description
    AF_INET Enable or disable the IPv4 firewall.
    AF_INET6 Enable or disable the IPv6 firewall.
    AF_UNSPEC Enable or disable both the IPv4 and IPv6 firewall.
  • bEnable
    [in] Specify TRUE to enable firewall or FALSE to disable it.

  • bPersist
    [in] Specify whether to save the setting in the registry so that it is preserved when a reboot occurs: TRUE or FALSE.

Remarks

The initial state of the firewall, after the device boots, is either enabled or disabled, depending on registry settings. You can change the default settings by using this function with bPersist set to TRUE.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Fwapi.h.
Link Library: Fwapi.lib.

See Also

Firewall Functions | IP Firewall Registry Settings

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.