次の方法で共有


FirewallEnable (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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

Parameters

  • Family
    [in] 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] TRUE to enable the firewall, or FALSE to disable it.
  • bPersist
    [in] TRUE to save the setting in the registry so that it is preserved when a reboot occurs, or FALSE otherwise.

Return Value

Returns ERROR_SUCCESS if operation succeeds. Otherwise, this function returns a DWORD error code.

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

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

See Also

Reference

IP Firewall Functions

Concepts

IP Firewall Registry Settings