Share via


FirewallEnableRule

This function enables or disables a firewall rule.

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

Parameters

  • hRule
    [in] Handle to the rule to enable or disable.
  • bEnabled
    [in] Specifies whether the rule should be enabled: TRUE or FALSE.
  • bPersist
    [in] Specifies whether to save the setting in the registry so that it preserved when a reboot occurs: TRUE or FALSE.

Return Values

Returns ERROR_SUCCESS if operation succeeds.

Requirements

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

See Also

Firewall Functions | HRULE | System Errors - Alphabetical Order

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.