Specifies the list of local ports for this rule.
Syntax (put)
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.
| Value | Meaning |
- "*"
| 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)
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 code | Description |
- 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
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 client | Windows Vista |
| Minimum supported server | Windows Server 2008 |
| Header | Netfw.h |
| DLL | FirewallAPI.dll |
See Also
- INetFwRule
Send comments about this topic to Microsoft
Build date: 10/8/2009