VpnChannel VpnChannel VpnChannel VpnChannel Class

Definition

Provides methods to create and destroy a VPN channel, and methods to perform buffer management. A VPN channel is the object in the system that links the network traffic data flow between the VPN plug-in's VPN server socket and the client machine network stack.

public : sealed class VpnChannel : IVpnChannel, IVpnChannel2public sealed class VpnChannel : IVpnChannel, IVpnChannel2Public NotInheritable Class VpnChannel Implements IVpnChannel, IVpnChannel2// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Properties

Configuration Configuration Configuration Configuration

Gets or sets a VpnChannelConfiguration object corresponding to the configuration of the VpnChannel and which dictates how to establish the communication with the VPN server.

public : VpnChannelConfiguration Configuration { get; }public VpnChannelConfiguration Configuration { get; }Public ReadOnly Property Configuration As VpnChannelConfiguration// This API is not available in Javascript.
Value
VpnChannelConfiguration VpnChannelConfiguration VpnChannelConfiguration VpnChannelConfiguration

A VpnChannelConfiguration object containing the configuration pertaining the VpnChannel object.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. There can only be one VPN profile per process because the VPN plug-in only has one VPN profile mapped to it, and if a caller were to create more than one profile object, they would all refer to the same settings.

Id Id Id Id

Gets the unique instance ID of a VPN channel. This can be used to simplify demuxing operations between two VPN connection instances.

public : unsigned int Id { get; }public uint Id { get; }Public ReadOnly Property Id As uint// This API is not available in Javascript.
Value
unsigned int uint uint uint

A number representing the unique ID of the VPN channel.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. There can only be one VPN profile per process because the VPN plug-in only has one VPN profile mapped to it, and if a caller were to create more than one profile object, they would all refer to the same settings.

PlugInContext PlugInContext PlugInContext PlugInContext

Gets or sets a context object that VPN plug-ins can use to associate their internal state with a VpnChannel object for later use while the session is in progress.

public : PlatForm::Object PlugInContext { get; set; }public object PlugInContext { get; set; }Public ReadWrite Property PlugInContext As object// This API is not available in Javascript.
Value
PlatForm::Object object object object

The contents of the Object are defined by the individual plug-in, based on the needs of the plug-in.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

SystemHealth SystemHealth SystemHealth SystemHealth

Gets the statement of health of the client machine.

public : VpnSystemHealth SystemHealth { get; }public VpnSystemHealth SystemHealth { get; }Public ReadOnly Property SystemHealth As VpnSystemHealth// This API is not available in Javascript.
Value
VpnSystemHealth VpnSystemHealth VpnSystemHealth VpnSystemHealth

A pointer to the VpnSystemHealth class that provides access to the statement of health for the client machine.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Methods

AssociateTransport(Object, Object) AssociateTransport(Object, Object) AssociateTransport(Object, Object) AssociateTransport(Object, Object)

Prepares and marks the transport for use by the VPN framework as a transport link communicating the VPN plug-in to the VPN server. This call must be performed before any other operations related to the VPN framework APIs.

public : void AssociateTransport(PlatForm::Object mainOuterTunnelTransport, PlatForm::Object optionalOuterTunnelTransport)public void AssociateTransport(Object mainOuterTunnelTransport, Object optionalOuterTunnelTransport)Public Function AssociateTransport(mainOuterTunnelTransport As Object, optionalOuterTunnelTransport As Object) As void// This API is not available in Javascript.
Parameters
mainOuterTunnelTransport
PlatForm::Object Object Object Object

An IInspectable object for socket transport. This object can be a Windows.Networking.StreamSocket, a Windows.Networking.StreamWebSocket, or a Windows.Networking.DatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data. The socket must be unconnected at the point of the call.

optionalOuterTunnelTransport
PlatForm::Object Object Object Object

An optional IInspectable object for socket transport. This object can be a Windows.Networking.StreamSocket, a Windows.Networking.StreamWebSocket, or a Windows.Networking.DatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

If the function succeeds, the return value is S_OK, otherwise the function will return an error hresult value describing the specific failure. If the plug-in is not connected, the error will be E_ACCESSDENIED.

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. The call will fail if the VPN framework does not support the specified type of transport implemented by the outerTunnelTransport object. The socket must have not been connected at the time of this call, otherwise the call will fail with an invalid parameter error.

A plugin may choose between the following combinations of sockets:

GetVpnReceivePacketBuffer() GetVpnReceivePacketBuffer() GetVpnReceivePacketBuffer() GetVpnReceivePacketBuffer()

Requests a VpnPacketBuffer object from the receive packet buffer pool to be used in the decapsulation or injection of a received packet from the VPN server into the local network stack

public : VpnPacketBuffer GetVpnReceivePacketBuffer()public VpnPacketBuffer GetVpnReceivePacketBuffer()Public Function GetVpnReceivePacketBuffer() As VpnPacketBuffer// This API is not available in Javascript.
Returns

The requested packet buffer object.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

GetVpnSendPacketBuffer() GetVpnSendPacketBuffer() GetVpnSendPacketBuffer() GetVpnSendPacketBuffer()

Retrieves a VpnPacketBuffer object from the send packet buffer pool to use in encapsulation and transmission of a data packet from the client network stack to the VPN server.

public : VpnPacketBuffer GetVpnSendPacketBuffer()public VpnPacketBuffer GetVpnSendPacketBuffer()Public Function GetVpnSendPacketBuffer() As VpnPacketBuffer// This API is not available in Javascript.
Returns

The requested packet buffer object.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

LogDiagnosticMessage(String) LogDiagnosticMessage(String) LogDiagnosticMessage(String) LogDiagnosticMessage(String)

Writes a diagnostic message to the system log.

public : void LogDiagnosticMessage(PlatForm::String message)public void LogDiagnosticMessage(String message)Public Function LogDiagnosticMessage(message As String) As void// This API is not available in Javascript.
Parameters
message
PlatForm::String String String String

The text of the diagnostic message.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

The messages logged with LogDiagnosticMessage can be viewed using Event Viewer, under Application and Services Logs\Microsoft\Windows\Vpn Plugin Platform.

ProcessEventAsync(Object, Object) ProcessEventAsync(Object, Object) ProcessEventAsync(Object, Object) ProcessEventAsync(Object, Object)

Processes any pending VpnChannel events.

public : static void ProcessEventAsync(PlatForm::Object thirdPartyPlugIn, PlatForm::Object event)public static void ProcessEventAsync(Object thirdPartyPlugIn, Object event)Public Static Function ProcessEventAsync(thirdPartyPlugIn As Object, event As Object) As void// This API is not available in Javascript.
Parameters
thirdPartyPlugIn
PlatForm::Object Object Object Object

The plug-in to be processed.

event
PlatForm::Object Object Object Object

The event object that was passed to the app from a background task Run method parameter. App code calling ProcessEventAsync treats this object as an opaque blob it is passing from the background task to the event processing code. (In the event processing code, the object will be understood and parsed appropriately.)

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

RequestCredentials(VpnCredentialType, Boolean, Boolean, Certificate) RequestCredentials(VpnCredentialType, Boolean, Boolean, Certificate) RequestCredentials(VpnCredentialType, Boolean, Boolean, Certificate) RequestCredentials(VpnCredentialType, Boolean, Boolean, Certificate)

Request the VPN platform to collect credentials from the user. The plug-in can specify the type and form of credentials to collect. The result is an object containing the main credentials depending on the type and the secondary credentials for change and expiration cases.

public : VpnPickedCredential RequestCredentials(VpnCredentialType credType, bool isRetry, bool isSingleSignOnCredential, Certificate certificate)public VpnPickedCredential RequestCredentials(VpnCredentialType credType, Boolean isRetry, Boolean isSingleSignOnCredential, Certificate certificate)Public Function RequestCredentials(credType As VpnCredentialType, isRetry As Boolean, isSingleSignOnCredential As Boolean, certificate As Certificate) As VpnPickedCredential// This API is not available in Javascript.
Parameters
credType
VpnCredentialType VpnCredentialType VpnCredentialType VpnCredentialType

An enum value indicating type of credential to collect.

isRetry
bool Boolean Boolean Boolean

If the request is a retry from as previous failed attempt, it is TRUE; otherwise, it is FALSE.

isSingleSignOnCredential
bool Boolean Boolean Boolean

If the credential should be used by all applications operating over the VPN tunnel and authenticating to resources on the VPN, it is TRUE; otherwise, it is FALSE. This provides a single sign on experience over the VPN.

certificate
Certificate Certificate Certificate Certificate

The certificate that can be optionally passed to indicate the platform its intention of use and obtain consent and unlock its protection.

Returns

An object containing the main credentials and any other transitional credentials filled by the user.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

If the function succeeds, the return value is S_OK, otherwise the function will return an error HRESULT value describing the specific failure. If the plug-in is not connected, the error is E_ACCESSDENIED. If there is no more memory available, the error is E_OUTOFMEMORY.

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile.

RequestCredentialsAsync(VpnCredentialType) RequestCredentialsAsync(VpnCredentialType) RequestCredentialsAsync(VpnCredentialType) RequestCredentialsAsync(VpnCredentialType)

Requests the VPN platform to collect credentials of a given credential type from the user.

public : IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType)public IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType)Public Function RequestCredentialsAsync(credType As VpnCredentialType) As IAsyncOperation( Of VpnCredential )// This API is not available in Javascript.
Parameters
credType
VpnCredentialType VpnCredentialType VpnCredentialType VpnCredentialType

An enum value indicating the type of credential to collect.

Returns

An asynchronous retrieval operation on a VpnCredential object containing the main credentials of the requested type, and secondary credentials for change and expiration cases.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider
See Also

RequestCredentialsAsync(VpnCredentialType, UInt32) RequestCredentialsAsync(VpnCredentialType, UInt32) RequestCredentialsAsync(VpnCredentialType, UInt32) RequestCredentialsAsync(VpnCredentialType, UInt32)

Requests the VPN platform to collect credentials from the user. The plug-in can specify the type and form of credentials to collect. The result is an object containing the main credentials depending on the type, and the secondary credentials for change and expiration cases.

public : IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType, unsigned int credOptions)public IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType, UInt32 credOptions)Public Function RequestCredentialsAsync(credType As VpnCredentialType, credOptions As UInt32) As IAsyncOperation( Of VpnCredential )// This API is not available in Javascript.
Parameters
credType
VpnCredentialType VpnCredentialType VpnCredentialType VpnCredentialType

An enum value indicating the type of credential to collect.

credOptions
unsigned int UInt32 UInt32 UInt32

Specifies the values defining whether a requested credential is a retry case, or should be used for single sign on.

See VpnChannelRequestCredentialsOptions for possible values.

Returns

An asynchronous retrieval operation on a VpnCredential object containing the main credentials of the requested type, and secondary credentials for change and expiration cases.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider
See Also

RequestCredentialsAsync(VpnCredentialType, UInt32, Certificate) RequestCredentialsAsync(VpnCredentialType, UInt32, Certificate) RequestCredentialsAsync(VpnCredentialType, UInt32, Certificate) RequestCredentialsAsync(VpnCredentialType, UInt32, Certificate)

VPN platform to collect credentials from the user. If user interaction is required to obtain a credential or consent, the platform provides the necessary user interaction. A VPN plug-in must request credentials before using any type of credential, even if the intent is not to invoke user interaction for it.

public : IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType, unsigned int credOptions, Certificate certificate)public IAsyncOperation<VpnCredential> RequestCredentialsAsync(VpnCredentialType credType, UInt32 credOptions, Certificate certificate)Public Function RequestCredentialsAsync(credType As VpnCredentialType, credOptions As UInt32, certificate As Certificate) As IAsyncOperation( Of VpnCredential )// This API is not available in Javascript.
Parameters
credType
VpnCredentialType VpnCredentialType VpnCredentialType VpnCredentialType

An enum value indicating the type of credential to collect.

credOptions
unsigned int UInt32 UInt32 UInt32

Specifies the values defining whether a requested credential is a retry case, or should be used for single sign on.

See VpnChannelRequestCredentialsOptions for possible values.

certificate
Certificate Certificate Certificate Certificate

A certificate to be used in validating the credential.

Returns

An asynchronous retrieval operation on a VpnCredential object containing the main credentials of the requested type, and secondary credentials for change and expiration cases.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider
See Also

RequestCustomPrompt(IVectorView) RequestCustomPrompt(IVectorView) RequestCustomPrompt(IVectorView) RequestCustomPrompt(IVectorView)

Not supported.

public : void RequestCustomPrompt(IVectorView<IVpnCustomPrompt> customPrompt)public void RequestCustomPrompt(IReadOnlyList<IVpnCustomPrompt> customPrompt)Public Function RequestCustomPrompt(customPrompt As IReadOnlyList<IVpnCustomPrompt>) As void// This API is not available in Javascript.
Parameters
customPrompt
IVectorView<IVpnCustomPrompt> IReadOnlyList<IVpnCustomPrompt> IReadOnlyList<IVpnCustomPrompt> IReadOnlyList<IVpnCustomPrompt>

Not used.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

RequestCustomPromptAsync(IVectorView) RequestCustomPromptAsync(IVectorView) RequestCustomPromptAsync(IVectorView) RequestCustomPromptAsync(IVectorView)

Requests information from the user by presenting a prompt. Allows the use of prompt elements that can be mixed to construct a full prompt to the user. Input provided by the user is returned to the caller in the objects specified.

public : IAsyncAction RequestCustomPromptAsync(IVectorView<IVpnCustomPromptElement> customPromptElement)public IAsyncAction RequestCustomPromptAsync(IReadOnlyList<IVpnCustomPromptElement> customPromptElement)Public Function RequestCustomPromptAsync(customPromptElement As IReadOnlyList<IVpnCustomPromptElement>) As IAsyncAction// This API is not available in Javascript.
Parameters
customPromptElement
IVectorView<IVpnCustomPromptElement> IReadOnlyList<IVpnCustomPromptElement> IReadOnlyList<IVpnCustomPromptElement> IReadOnlyList<IVpnCustomPromptElement>

A list custom prompt elements.

Returns

Represents an asynchronous action.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

RequestVpnPacketBuffer(VpnDataPathType, VpnPacketBuffer) RequestVpnPacketBuffer(VpnDataPathType, VpnPacketBuffer) RequestVpnPacketBuffer(VpnDataPathType, VpnPacketBuffer) RequestVpnPacketBuffer(VpnDataPathType, VpnPacketBuffer)

Not supported. Requests a IVpnPacketBuffer from the specified pool. There is one IVpnPacketBuffer for the send path and another IVpnPacketBuffer for the receive path

public : void RequestVpnPacketBuffer(VpnDataPathType type, VpnPacketBuffer vpnPacketBuffer)public void RequestVpnPacketBuffer(VpnDataPathType type, VpnPacketBuffer vpnPacketBuffer)Public Function RequestVpnPacketBuffer(type As VpnDataPathType, vpnPacketBuffer As VpnPacketBuffer) As void// This API is not available in Javascript.
Parameters
type
VpnDataPathType VpnDataPathType VpnDataPathType VpnDataPathType

An enum value indicating which buffer pool to pick a buffer from. If the buffer requested for the packet to be sent to the VPN server, pick the Send enum type. If the buffer requested is for a received L3 decapsulated packet ready to be injected into the client network stack, pick the Receive enum type.

vpnPacketBuffer
VpnPacketBuffer VpnPacketBuffer VpnPacketBuffer VpnPacketBuffer

A IVpnPacketBuffer object returned from the specified buffer pool.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

If the function succeeds, the return value is S_OK, otherwise the function will return an error hresult value describing the specific failure. If the plug-in is not connected, the error will be E_ACCESSDENIED.If there is no more memory available the method will return E_OUTOFMEMORY.

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. There can only be one VPN profile per process because the VPN plug-in only has one VPN profile mapped to it, and if a caller were to create more than one profile object, they would all refer to the same settings.

SetAllowedSslTlsVersions(Object, Boolean) SetAllowedSslTlsVersions(Object, Boolean) SetAllowedSslTlsVersions(Object, Boolean) SetAllowedSslTlsVersions(Object, Boolean)

Not supported.

public : void SetAllowedSslTlsVersions(PlatForm::Object tunnelTransport, bool useTls12)public void SetAllowedSslTlsVersions(Object tunnelTransport, Boolean useTls12)Public Function SetAllowedSslTlsVersions(tunnelTransport As Object, useTls12 As Boolean) As void// This API is not available in Javascript.
Parameters
tunnelTransport
PlatForm::Object Object Object Object

An optional IInspectable object for socket transport. The object can be a Windows.Networking.StreamSocket, Windows.Networking.WebStreamSocket or Windows.Networking.DatagramSocket. This socket controls the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

useTls12
bool Boolean Boolean Boolean

If Transport Security Layer 1.2 should be used, it is TRUE; otherwise, it is FALSE.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

SetErrorMessage(String) SetErrorMessage(String) SetErrorMessage(String) SetErrorMessage(String)

Not supported.

public : void SetErrorMessage(PlatForm::String message)public void SetErrorMessage(String message)Public Function SetErrorMessage(message As String) As void// This API is not available in Javascript.
Parameters
message
PlatForm::String String String String

The text of the error message.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Start(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnNamespaceAssignment, UInt32, UInt32, Boolean, Object, Object) Start(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnNamespaceAssignment, UInt32, UInt32, Boolean, Object, Object) Start(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnNamespaceAssignment, UInt32, UInt32, Boolean, Object, Object) Start(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnNamespaceAssignment, UInt32, UInt32, Boolean, Object, Object)

Creates the VPN channel to be used by the VPN plug-in. It also creates an L3 network interface for applications in the client machine to be able to see the corporate network.

public : void Start(IVectorView<HostName> assignedClientIPv4list, IVectorView<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment routeScope, VpnNamespaceAssignment namespaceScope, unsigned int mtuSize, unsigned int maxFrameSize, bool optimizeForLowCostNetwork, PlatForm::Object mainOuterTunnelTransport, PlatForm::Object optionalOuterTunnelTransport)public void Start(IReadOnlyList<HostName> assignedClientIPv4list, IReadOnlyList<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment routeScope, VpnNamespaceAssignment namespaceScope, UInt32 mtuSize, UInt32 maxFrameSize, Boolean optimizeForLowCostNetwork, Object mainOuterTunnelTransport, Object optionalOuterTunnelTransport)Public Function Start(assignedClientIPv4list As IReadOnlyList<HostName>, assignedClientIPv6list As IReadOnlyList<HostName>, vpnInterfaceId As VpnInterfaceId, routeScope As VpnRouteAssignment, namespaceScope As VpnNamespaceAssignment, mtuSize As UInt32, maxFrameSize As UInt32, optimizeForLowCostNetwork As Boolean, mainOuterTunnelTransport As Object, optionalOuterTunnelTransport As Object) As void// This API is not available in Javascript.
Parameters
assignedClientIPv4list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to an IVectorView< Windows.Networking.HostName > vector specifying the IPv4 address assigned by the VPN server to the VPN client. The address should be set on the VPN L3 interface. If **null*, DHCPv4 is used.

assignedClientIPv6list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a Windows.Networking.HostName structure specifying the IPv6 address assigned by the VPN server to the VPN client, and which should be set on the VPN L3 interface. If null, DHCPv6 or RD is used.

vpnInterfaceId
VpnInterfaceId VpnInterfaceId VpnInterfaceId VpnInterfaceId

A pointer to a VpnInterfaceId.

routeScope
VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment

A pointer to Windows.Networking.VpnRouteAssignment class that represents the routes which should be associated / not associated with the VPN interface

namespaceScope
VpnNamespaceAssignment VpnNamespaceAssignment VpnNamespaceAssignment VpnNamespaceAssignment

A pointer to Windows.Networking.DomainNameAssignment class that represents the list of name prefixes that are associated to the VPN channel, including its DNS and proxy servers.

mtuSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the MTU size of the VPN L3 network interface. This is also the size of the IVpnPacketBuffers in the Receive pool.

maxFrameSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the max size of the frame defined by the VPN protocol encapsulation without counting the outerTunnelTransport. This is also the size of the IVpnPacketBuffers in the Send pool.

optimizeForLowCostNetwork
bool Boolean Boolean Boolean

A Boolean specifying whether the VPN framework should monitor and use low cost networks as they are available. If TRUE the VPN framework will invoke the connect() callback to the VPN plug-in to reconnect it whenever the old network was costed and a new low cost network becomes available.

mainOuterTunnelTransport
PlatForm::Object Object Object Object

An IInspectable object for socket transport. The object can be a Windows.Networking.StreamSocket, Windows.Networking.WebStreamSocket or Windows.Networking.DatagramSocket. This socket controls the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

optionalOuterTunnelTransport
PlatForm::Object Object Object Object

An optional IInspectable object for socket transport. The object can be a Windows.Networking.StreamSocket, Windows.Networking.WebStreamSocket or Windows.Networking.DatagramSocket. This socket controls the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

If the function succeeds, the return value is S_OK, otherwise the function will return an error hresult value describing the specific failure. If the plug-in is not connected, the error will be E_ACCESSDENIED.

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. There can only be one VPN profile per process because the VPN plug-in only has one VPN profile mapped to it, and if a caller were to create more than one profile object, they would all refer to the same settings.

On success the ownership of outertTunnelTransport is transferred by the VPN framework. Calling this method multiple times with the same parameters will have no effect. Calling this method multiple times with variations in parameter values will make sure the channel is updated with the latest values without any disruptions to other properties.

There can only be one VPN channel per process and hence a VPN plug-in can only have one VPN channel assigned to it. The mtuSize must always be smaller than the maxFrameSize.

StartExistingTransports(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean) StartExistingTransports(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean) StartExistingTransports(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean) StartExistingTransports(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean)

Creates the VPN channel to be used by the VPN plug-in. It also creates an L3 network interface for applications in the client machine to be able to see the corporate network.

public : void StartExistingTransports(IVectorView<HostName> assignedClientIPv4list, IVectorView<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedDomainName, unsigned int mtuSize, unsigned int maxFrameSize, bool Reserved)public void StartExistingTransports(IReadOnlyList<HostName> assignedClientIPv4list, IReadOnlyList<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedDomainName, UInt32 mtuSize, UInt32 maxFrameSize, Boolean Reserved)Public Function StartExistingTransports(assignedClientIPv4list As IReadOnlyList<HostName>, assignedClientIPv6list As IReadOnlyList<HostName>, vpnInterfaceId As VpnInterfaceId, assignedRoutes As VpnRouteAssignment, assignedDomainName As VpnDomainNameAssignment, mtuSize As UInt32, maxFrameSize As UInt32, Reserved As Boolean) As void// This API is not available in Javascript.
Parameters
assignedClientIPv4list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to aWindows.Networking.HostName structure specifying the IPv4 address assigned by the VPN server to the VPN client. The address should be set on the VPN L3 interface. If null, DHCPv4 is used.

assignedClientIPv6list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a Windows.Networking.HostName structure specifying the IPv6 address assigned by the VPN server to the VPN client, and which should be set on the VPN L3 interface. If null, DHCPv6 or RD is used.

vpnInterfaceId
VpnInterfaceId VpnInterfaceId VpnInterfaceId VpnInterfaceId

A pointer to a VpnInterfaceId object.

assignedRoutes
VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment

A pointer to a Windows.Networking.VpnRouteAssignment class that represents the routes which should be associated / not associated with the VPN interface.

assignedDomainName
VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment

A pointer to a Windows.Networking.DomainNameAssignment class that represents the list of name prefixes that are associated to the VPN channel, including its DNS and proxy servers.

mtuSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the MTU size of the VPN L3 network interface. This is also the size of the IVpnPacketBuffers in the Receive pool.

maxFrameSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the max size of the frame defined by the VPN protocol encapsulation without counting the outerTunnelTransport. This is also the size of the IVpnPacketBuffers in the Send pool.

Reserved
bool Boolean Boolean Boolean

Reserved.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

StartWithMainTransport(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object) StartWithMainTransport(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object) StartWithMainTransport(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object) StartWithMainTransport(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object)

Creates the VPN channel to be used by the VPN plug-in. It also creates an L3 network interface for applications in the client machine to be able to see the corporate network.

public : void StartWithMainTransport(IVectorView<HostName> assignedClientIPv4list, IVectorView<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedDomainName, unsigned int mtuSize, unsigned int maxFrameSize, bool Reserved, PlatForm::Object mainOuterTunnelTransport)public void StartWithMainTransport(IReadOnlyList<HostName> assignedClientIPv4list, IReadOnlyList<HostName> assignedClientIPv6list, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedDomainName, UInt32 mtuSize, UInt32 maxFrameSize, Boolean Reserved, Object mainOuterTunnelTransport)Public Function StartWithMainTransport(assignedClientIPv4list As IReadOnlyList<HostName>, assignedClientIPv6list As IReadOnlyList<HostName>, vpnInterfaceId As VpnInterfaceId, assignedRoutes As VpnRouteAssignment, assignedDomainName As VpnDomainNameAssignment, mtuSize As UInt32, maxFrameSize As UInt32, Reserved As Boolean, mainOuterTunnelTransport As Object) As void// This API is not available in Javascript.
Parameters
assignedClientIPv4list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a Windows.Networking.HostName structure specifying the IPv4 address assigned by the VPN server to the VPN client. The address should be set on the VPN L3 interface. If null, DHCPv4 is used.

assignedClientIPv6list
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a Windows.Networking.HostName structure specifying the IPv6 address assigned by the VPN server to the VPN client, and which should be set on the VPN L3 interface. If null, DHCPv6 or RD is used.

vpnInterfaceId
VpnInterfaceId VpnInterfaceId VpnInterfaceId VpnInterfaceId

A pointer to a VpnInterfaceId object.

assignedRoutes
VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment

A pointer to a **Windows.Networking.VpnRouteAssignment ** class that represents the routes which should be associated / not associated with the VPN interface.

assignedDomainName
VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment

A pointer to a Windows.Networking.DomainNameAssignment class that represents the list of name prefixes that are associated to the VPN channel, including its DNS and proxy servers.

mtuSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the MTU size of the VPN L3 network interface. This is also the size of the IVpnPacketBuffers in the Receive pool.

maxFrameSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the max size of the frame defined by the VPN protocol encapsulation without counting the outerTunnelTransport. This is also the size of the IVpnPacketBuffers in the Send pool.

Reserved
bool Boolean Boolean Boolean

Reserved

mainOuterTunnelTransport
PlatForm::Object Object Object Object

An IInspectable object for socket transport. This object can be a Windows.Networking.StreamSocket, a Windows.Networking.WebStreamSocket, or a Windows.NetworkingDatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data. The socket must be unconnected at the point of the call.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

StartWithTrafficFilter(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object, Object, VpnTrafficFilterAssignment) StartWithTrafficFilter(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object, Object, VpnTrafficFilterAssignment) StartWithTrafficFilter(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object, Object, VpnTrafficFilterAssignment) StartWithTrafficFilter(IVectorView, IVectorView, VpnInterfaceId, VpnRouteAssignment, VpnDomainNameAssignment, UInt32, UInt32, Boolean, Object, Object, VpnTrafficFilterAssignment)

Creates the VPN channel to be used by the VPN plug-in. It also creates an L3 network interface for applications in the client machine to be able to see the corporate network. It allows the specification of traffic filters to use in per app VPN scenarios.

public : void StartWithTrafficFilter(IVectorView<HostName> assignedClientIpv4List, IVectorView<HostName> assignedClientIpv6List, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedNamespace, unsigned int mtuSize, unsigned int maxFrameSize, bool reserved, PlatForm::Object mainOuterTunnelTransport, PlatForm::Object optionalOuterTunnelTransport, VpnTrafficFilterAssignment assignedTrafficFilters)public void StartWithTrafficFilter(IReadOnlyList<HostName> assignedClientIpv4List, IReadOnlyList<HostName> assignedClientIpv6List, VpnInterfaceId vpnInterfaceId, VpnRouteAssignment assignedRoutes, VpnDomainNameAssignment assignedNamespace, UInt32 mtuSize, UInt32 maxFrameSize, Boolean reserved, Object mainOuterTunnelTransport, Object optionalOuterTunnelTransport, VpnTrafficFilterAssignment assignedTrafficFilters)Public Function StartWithTrafficFilter(assignedClientIpv4List As IReadOnlyList<HostName>, assignedClientIpv6List As IReadOnlyList<HostName>, vpnInterfaceId As VpnInterfaceId, assignedRoutes As VpnRouteAssignment, assignedNamespace As VpnDomainNameAssignment, mtuSize As UInt32, maxFrameSize As UInt32, reserved As Boolean, mainOuterTunnelTransport As Object, optionalOuterTunnelTransport As Object, assignedTrafficFilters As VpnTrafficFilterAssignment) As void// This API is not available in Javascript.
Parameters
assignedClientIpv4List
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a **Windows.Networking.HostName ** structure specifying the IPv4 address assigned by the VPN server to the VPN client. The address should be set on the VPN L3 interface. If null, DHCPv4 is used.

assignedClientIpv6List
IVectorView<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName> IReadOnlyList<HostName>

A pointer to a Windows.Networking.HostName structure specifying the IPv6 address assigned by the VPN server to the VPN client, and which should be set on the VPN L3 interface. If null, DHCPv6 or RD is used.

vpnInterfaceId
VpnInterfaceId VpnInterfaceId VpnInterfaceId VpnInterfaceId

A pointer to a VpnInterfaceId object.

assignedRoutes
VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment VpnRouteAssignment

A pointer to a **Windows.Networking.VpnRouteAssignment ** class that represents the routes which should be associated / not associated with the VPN interface.

assignedNamespace
VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment VpnDomainNameAssignment

A pointer to a Windows.Networking.DomainNameAssignment class that represents the list of name prefixes that are associated to the VPN channel, including its DNS and proxy servers.

mtuSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the MTU size of the VPN L3 network interface. This is also the size of the IVpnPacketBuffers in the Receive pool.

maxFrameSize
unsigned int UInt32 UInt32 UInt32

A UINT16 value specifying the max size of the frame defined by the VPN protocol encapsulation without counting the outerTunnelTransport. This is also the size of the IVpnPacketBuffers in the Send pool.

reserved
bool Boolean Boolean Boolean

Reserved.

mainOuterTunnelTransport
PlatForm::Object Object Object Object

An IInspectable object for socket transport. This object can be a Windows.Networking.StreamSocket, a Windows.Networking.WebStreamSocket, or a Windows.NetworkingDatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data. The socket must be unconnected at the point of the call.

optionalOuterTunnelTransport
PlatForm::Object Object Object Object

An optional IInspectable object for socket transport. This object can be a Windows.Networking.StreamSocket, a Windows.Networking.WebStreamSocket, or a Windows.NetworkingDatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

assignedTrafficFilters
VpnTrafficFilterAssignment VpnTrafficFilterAssignment VpnTrafficFilterAssignment VpnTrafficFilterAssignment

A pointer to a VpnTrafficFilterAssignment object, that allows the specification of traffic filters to a VPN channel.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Stop() Stop() Stop() Stop()

Destroys a previously established VPN channel object. Disassociates and closes the outerTunnelTransport connection to the VPN server.

public : void Stop()public void Stop()Public Function Stop() As void// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Remarks

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. There can only be one VPN profile per process because the VPN plug-in only has one VPN profile mapped to it, and if a caller were to create more than one profile object, they would all refer to the same settings.

TerminateConnection(String) TerminateConnection(String) TerminateConnection(String) TerminateConnection(String)

Allows a VPN plugin to indicate an error message and terminate the connection attempt performed inside the IVpnPlugin.Connect method. Should not be called on reconnect cases.

public : void TerminateConnection(PlatForm::String message)public void TerminateConnection(String message)Public Function TerminateConnection(message As String) As void// This API is not available in Javascript.
Parameters
message
PlatForm::String String String String

The text of the error message.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

Events

ActivityChange ActivityChange ActivityChange ActivityChange

Not supported.

public : event TypedEventHandler ActivityChange<VpnChannel,  VpnChannelActivityEventArgs>public event TypedEventHandler ActivityChange<VpnChannel,  VpnChannelActivityEventArgs>Public Event ActivityChange<VpnChannel,  VpnChannelActivityEventArgs>// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider

ActivityStateChange ActivityStateChange ActivityStateChange ActivityStateChange

Event raised when the channel's activity state has changed. Used by VPN plug-ins to determine whether the channel is active with traffic or idle.

public : event TypedEventHandler ActivityStateChange<VpnChannel,  VpnChannelActivityStateChangedArgs>public event TypedEventHandler ActivityStateChange<VpnChannel,  VpnChannelActivityStateChangedArgs>Public Event ActivityStateChange<VpnChannel,  VpnChannelActivityStateChangedArgs>// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
networkingVpnProvider