FirewallCreateRule (Windows CE 5.0)
This function creates a new firewall rule.
Security 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.
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 Values
Returns ERROR_SUCCESS if operation succeeds.
Remarks
On success, this function sets HRULE to the rule handle for this new rule.
Requirements
OS Versions: Windows CE .NET 4.2 and later.
Header: Fwapi.h.
Link Library: Fwapi.lib.
See Also
IP Firewall Functions | System Errors - Alphabetical Order
Send Feedback on this topic to the authors