Export (0) Print
Expand All

INetFwRules::Add method

The Add method adds a new rule to the collection.

Syntax


HRESULT Add(
  [in]  INetFwRule *rule
);

Parameters

rule [in]

Rule to be added to the collection via an INetFwRule object.

Return value

C++

If the method succeeds the return value is S_OK.

If the method fails, the return value is one of the following error codes.

Return codeDescription
E_ACCESSDENIED

The operation was aborted due to permissions issues.

E_INVALIDARG

The method failed because a parameter was not valid.

E_UNEXPECTED

The method failed because the object is already in the collection.

 

VB

If the method succeeds the return value is S_OK.

If the method fails, the return value is one of the following error codes.

Return codeDescription
E_ACCESSDENIED

The operation was aborted due to permissions issues.

E_INVALIDARG

The method failed because a parameter was not valid.

E_UNEXPECTED

The method failed because the object is already in the collection.

 

Remarks

If a rule with the same rule identifier as the one being submitted already exists, the existing rule is overwritten.

Adding a firewall rule with a LocalAppPackageId specified can lead to unexpected behavior and is not supported.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Netfw.h

DLL

FirewallAPI.dll

See also

INetFwRules
INetFwRule

 

 

Build date: 11/16/2013

Community Additions

ADD
Show:
© 2014 Microsoft