INetFwRule::LocalPorts Property

Specifies the list of local ports for this rule.


Syntax (put)

C++
HRESULT put_LocalPorts(
  [in]   BSTR portNumbers
);

Parameters

portNumbers [in]

Sets the comma-delimited list of local ports for this rule. This list must contain no spaces.

ValueMeaning
"*"

All local ports are affected by this rule.

"RPC"

RPC ports are affected by this rule.

"RPC-EPMap"

RPC Endpoint Mapper ports are affected by this rule.

"Teredo"

Protected local IPv6 ports are affected by this rule.

 

Syntax (get)

C++
 HRESULT get_LocalPorts(
  [out]  BSTR *portNumbers
);

Parameters

portNumbers [out]

Gets the list of local ports for this rule.

Return Value

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 due to an invalid parameter.

E_OUTOFMEMORY

The method was unable to allocate required memory.

E_POINTER

The method failed due to an invalid pointer.

 


Syntax

VBScript
Property LocalPorts As String

Property Value

The list of local ports.

Remarks

This property is optional.

Also see the restrictions on changing properties described in the Remarks section of the INetFwRule interface page.

The Protocol property must be set before the LocalPorts property or an error will be returned.

Requirements

Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderNetfw.h
DLLFirewallAPI.dll

See Also

INetFwRule

Send comments about this topic to Microsoft

Build date: 10/8/2009

Tags :


Page view tracker