다음을 통해 공유


FirewallCreateRule (Windows Embedded CE 6.0)

1/6/2010

This function creates a new firewall rule.

Ee494040.security(en-US,WinEmbedded.60).gifSecurity Note:
The IP Firewall handles fragments in a manner that helps to prevent attacks on the private host stack. Do not add a rule to allow traffic to a host if the host's stack does not support these defense mechanisms. The following list shows these defense mechanisms:
  • If no rule allows traffic to the packet destination, the firewall blocks fragments to that destination.
  • If a fragment contains a transport layer header, the firewall drops the fragment.

Syntax

DWORD FirewallCreateRule(
  FW_RULE* pRule, 
  BOOL bPersist
);

Parameters

  • pRule
    [out] Pointer to the FW_RULE structure that specifies the rule to create.
  • bPersist
    [in] TRUE to save the rule in the registry so that it is preserved when a reboot occurs. Specify FALSE if the rule is not saved.

Return Value

Returns ERROR_SUCCESS if operation succeeds.

Remarks

On success, this function sets HRULE to the rule handle for this new rule.

Requirements

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

See Also

Reference

IP Firewall Functions

Other Resources

System Errors - Alphabetical Order