Export (0) Print
Expand All

IFPCTunnelPortRanges::AddRange[C++] | FPCTunnelPortRanges.AddRange [Visual Basic]

Internet Security and Acceleration Server 2004/2006 SDK

The AddRange method creates a new FPCTunnelPortRange object in the collection and returns a reference to it.


HRESULT AddRange(
  BSTR bstrName,
  long lLowPort,
  long lHighPort,
  IFPCTunnelPortRange** ppNewDest );

Parameters

bstrName
[in] Required. String value that specifies the name of the new tunnel port range.
lLowPort
[in] Required. A 32-bit integer that specifies the low end of the port range. The range of permissible values is from 1 through 65535.
lHighPort
[in] Required. A 32-bit integer that specifies the high end of the port range. The range of permissible values is from 1 through 65535.
ppNewDest
[out] Address of an interface pointer that on return points to the new IFPCTunnelPortRange interface created.

Return Values

This method can return one of the following:

  • S_OK, indicating that the operation succeeded.
  • An error code, indicating that the operation failed. In this case, the [out] parameter returned is a null object.

Remarks

After the FPCTunnelPortRange collection is modified by calling this method, the changes must be written to persistent storage by calling the Save method, and the Microsoft Firewall service must be restarted for the changes to take effect. For more information about restarting the Firewall service to apply changes, see Restarting Services After Configuration Changes.

The AddRange method creates a new FPCTunnelPortRange object in the collection and returns a reference to it.


Function AddRange( _
  ByVal bstrName As String, _
  ByVal lLowPort As Long, _
  ByVal lHighPort As Long _
) As FPCTunnelPortRange

Parameters

bstrName
[in] Required. String value that specifies the name of the new tunnel port range.
lLowPort
[in] Required. A 32-bit integer that specifies the low end of the port range. The range of permissible values is from 1 through 65535.
lHighPort
[in] Required. A 32-bit integer that specifies the high end of the port range. The range of permissible values is from 1 through 65535.

Return Values

This method returns a reference to an FPCTunnelPortRange object if successful. Otherwise, an error is raised that can be intercepted by using an error handler.

Remarks

After the FPCTunnelPortRange collection is modified by calling this method, the changes must be written to persistent storage by calling the Save method, and the Microsoft Firewall service must be restarted for the changes to take effect. For more information about restarting the Firewall service to apply changes, see Restarting Services After Configuration Changes.

Example Code

The following VBScript code shows how to create a new tunnel port range consisting of a single port.
 ' Define the constants needed.
Const NewRangeName = "SSL 3520"
Const NewRangePort = "3520"

' Create the root object.
Dim root  ' The FPCLib.FPC root object
Set root = CreateObject("FPC.Root")

'Declare the other objects needed.
Dim isaArray     ' An ISA Server array object
Dim tpRanges     ' An FPCTunnelPortRanges collection
Dim newRange     ' An FPCTunnelPortRange object

' Get a reference to the array and to
' the collection of tunnel port ranges.
Set isaArray = root.GetContainingArray()
Set tpRanges = isaArray.ArrayPolicy.WebProxy.TunnelPortRanges

' Create a new tunnel port range.
Set newRange = tpRanges.AddRange(NewRangeName, NewRangePort, NewRangePort)

' Save the changes to the collection of tunnel port ranges
' with fResetRequiredServices set to True to restart the Firewall service.
tpRanges.Save True

Requirements

Client Requires Windows XP.
Server Requires Windows Server 2003. Requires Windows Server 2003 or Windows 2000 for ISA Server 2004 Standard Edition.
Version Requires Internet Security and Acceleration (ISA) Server 2006 or ISA Server 2004.
IDL

Declared in Msfpccom.idl.

DLL Requires Msfpccom.dll.

See Also

FPCTunnelPortRanges

Show:
© 2015 Microsoft