Windows Win32 API Nla
Windows Win32 API Nla
netlistmgr.h
ondemandconnroutehelper.h
Enumerations
NLM_CONNECTION_COST
The NLM_CONNECTION_COST enumeration specifies a set of cost levels and cost flags supported
in Windows 8 Cost APIs.
NLM_CONNECTION_PROPERTY_CHANGE
NLM_CONNECTIVITY
NLM_DOMAIN_AUTHENTICATION_KIND
NLM_DOMAIN_TYPE
The NLM_DOMAIN_TYPE enumeration is a set of flags that specify the domain type of a network.
NLM_ENUM_NETWORK
The NLM_ENUM_NETWORK enumeration contains a set of flags that specify what types of
networks are enumerated.
NLM_INTERNET_CONNECTIVITY
NLM_NETWORK_CATEGORY
The NLM_NETWORK_CATEGORY enumeration is a set of flags that specify the category type of a
network.
NLM_NETWORK_CLASS
NLM_NETWORK_CLASS enumeration defines a set of flags that specify if a network has been
identified.
NLM_NETWORK_PROPERTY_CHANGE
Functions
ClearSimulatedProfileInfo
Clears the connection profile values previously applied to the internet connection profile by
SetSimulatedProfileInfo. The next internet connection query, via GetInternetConnectionProfile, will
use system information.
Clone
The Clone method creates an enumerator that contains the same enumeration state as the
enumerator currently in use. (IEnumNetworkConnections.Clone)
Clone
The Clone method creates an enumerator that contains the same enumeration state as the
enumerator currently in use. (IEnumNetworks.Clone)
ConnectionCostChanged
ConnectivityChanged
CostChanged
CostChanged method is called to indicates a cost change for either machine-wide Internet
connectivity, or the first-hop of routing to a specific destination on a connection.
DataPlanStatusChanged
FreeInterfaceContextTable
This function frees the interface context table retrieved using the
GetInterfaceContextTableForHostName function.
get__NewEnum
The get_NewEnum property returns an automation enumerator object that you can use to iterate
through the IEnumNetworkConnections collection.
get__NewEnum
The get_NewEnum property returns an automation enumerator object that you can use to iterate
through the IEnumNetworks collection.
get_IsConnected
The get_IsConnected property specifies if the network has any network connectivity.
get_IsConnected
The get_IsConnected property specifies if the associated network connection has network
connectivity.
get_IsConnected
The get_IsConnected property specifies if the local machine has network connectivity.
get_IsConnectedToInternet
get_IsConnectedToInternet
get_IsConnectedToInternet
The get_IsConnectedToInternet property specifies if the local machine has internet connectivity.
GetAdapterId
The GetAdapterID method returns the ID of the network adapter used by this connection.
GetCategory
GetConnectionId
The GetConnectionID method returns the Connection ID associated with this network connection.
GetConnectivity
GetConnectivity
The GetConnectivity method returns the connectivity state of the network connection.
GetConnectivity
The GetConnectivity method returns the overall connectivity state of the machine.
GetCost
GetCost
GetCost method retrieves the current cost of either a machine-wide internet connection, or the
first-hop of routing to a specific destination on a connection.
GetDataPlanStatus
GetDataPlanStatus method retrieves the status of the data plan associated with a connection.
GetDataPlanStatus
GetDataPlanStatus retrieves the data plan status for either a machine-wide internet connection ,
or the first-hop of routing to a specific destination on a connection.
GetDescription
GetDomainType
GetDomainType
The GetDomainType method returns the domain type of the network connection.
GetInterfaceContextTableForHostName
This function retrieves an interface context table for the given hostname and connection profile
filter.
GetName
GetNetwork
The GetNetwork method returns the network associated with the connection.
GetNetwork
GetNetworkConnection
GetNetworkConnections
GetNetworkConnections
The GetNetworkConnections method enumerates a complete list of the network connections that
have been made.
GetNetworkId
GetNetworks
The GetNetworks method retrieves the list of networks available on the local machine.
GetTimeCreatedAndConnected
The GetTimeCreatedAndConnected method returns the local date and time when the network
was created and connected.
IsDomainAuthenticatedBy
Queries whether the specified domain authentication method succeeded for this network.
IsDomainAuthenticatedBy
Queries whether the specified domain authentication method succeeded for this network
connection.
NetworkAdded
The NetworkAdded method is called when a new network is added. The GUID of the new network
is provided.
NetworkConnectionConnectivityChanged
NetworkConnectionPropertyChanged
NetworkConnectivityChanged
NetworkDeleted
NetworkPropertyChanged
The Next method gets the next specified number of elements in the enumeration sequence.
(IEnumNetworkConnections.Next)
Next
The Next method gets the next specified number of elements in the enumeration sequence.
(IEnumNetworks.Next)
OnDemandGetRoutingHint
The OnDemandGetRoutingHint function looks up a destination in the Route Request cache and, if
a match is found, return the corresponding Interface ID.
OnDemandRegisterNotification
OnDemandUnRegisterNotification
Reset
Reset
The Reset method resets the enumeration sequence to the beginning. (IEnumNetworks.Reset)
SetCategory
The SetCategory method sets the category of a network. Changes made take effect immediately.
Callers of this API must be members of the Administrators group.
SetDescription
SetDestinationAddresses
SetSimulatedProfileInfo
The SetSimulatedProfileInfo method applies a specific set of connection profile values to the
internet connection profile in support of the simulation of specific metered internet connection
conditions.
Skip
The Skip method skips over the next specified number of elements in the enumeration sequence.
(IEnumNetworkConnections.Skip)
Skip
The Skip method skips over the next specified number of elements in the enumeration sequence.
(IEnumNetworks.Skip)
Interfaces
IEnumNetworkConnections
IEnumNetworks
The IEnumNetworks interface is a standard enumerator for networks. It enumerates all networks
available on the local machine. This interface can be obtained from the INetworkListManager
interface.
INetwork
The INetwork interface represents a network on the local machine. It can also represent a
collection of network connections with a similar network signature.
INetwork2
The INetwork2 interface represents a network on the local machine. It can also represent a
collection of network connections with a similar network signature.
INetworkConnection
INetworkConnection2
INetworkConnectionCost
To query current network cost and data plan status associated with a connection.
INetworkConnectionCostEvents
This interface to notify an application of cost and data plan status change events for a connection.
INetworkConnectionEvents
INetworkCostManager
Use this interface to query for machine-wide cost and data plan status information associated
with either a connection used for machine-wide Internet connectivity, or the first-hop of routing
to a specific destination on a connection.
INetworkCostManagerEvents
This interface to notify an application of machine-wide cost and data plan related events.
INetworkEvents
INetworkEvents is a notification sink interface that a client implements to get network related
events. These APIs are all callback functions that are called automatically when the respective
events are raised.
INetworkListManager
INetworkListManagerEvents
NET_INTERFACE_CONTEXT
NET_INTERFACE_CONTEXT_TABLE
NLM_DATAPLAN_STATUS
NLM_DATAPLAN_STATUS structure stores the current data plan status information supplied by the
carrier.
NLM_SIMULATED_PROFILE_INFO
Used to specify values that are used by SetSimulatedProfileInfo to override current internet
connection profile values in an RDP Child Session to support the simulation of specific metered
internet connection conditions.
NLM_SOCKADDR
NLM_USAGE_DATA
NLM_USAGE_DATA structure stores information that indicates the data usage of a plan.
Feedback
Was this page helpful? ツ Yes ト No
This header is used by Network List Manager. For more information, see:
Interfaces
IEnumNetworkConnections
IEnumNetworks
The IEnumNetworks interface is a standard enumerator for networks. It enumerates all networks
available on the local machine. This interface can be obtained from the INetworkListManager
interface.
INetwork
The INetwork interface represents a network on the local machine. It can also represent a
collection of network connections with a similar network signature.
INetwork2
The INetwork2 interface represents a network on the local machine. It can also represent a
collection of network connections with a similar network signature.
INetworkConnection
INetworkConnection2
INetworkConnectionCost
To query current network cost and data plan status associated with a connection.
INetworkConnectionCostEvents
This interface to notify an application of cost and data plan status change events for a connection.
INetworkConnectionEvents
INetworkCostManager
Use this interface to query for machine-wide cost and data plan status information associated
with either a connection used for machine-wide Internet connectivity, or the first-hop of routing
to a specific destination on a connection.
INetworkCostManagerEvents
This interface to notify an application of machine-wide cost and data plan related events.
INetworkEvents
INetworkEvents is a notification sink interface that a client implements to get network related
events. These APIs are all callback functions that are called automatically when the respective
events are raised.
INetworkListManager
INetworkListManagerEvents
Structures
NLM_DATAPLAN_STATUS
NLM_DATAPLAN_STATUS structure stores the current data plan status information supplied by the
carrier.
NLM_SIMULATED_PROFILE_INFO
Used to specify values that are used by SetSimulatedProfileInfo to override current internet
connection profile values in an RDP Child Session to support the simulation of specific metered
internet connection conditions.
NLM_SOCKADDR
NLM_USAGE_DATA
NLM_USAGE_DATA structure stores information that indicates the data usage of a plan.
Enumerations
NLM_CONNECTION_COST
The NLM_CONNECTION_COST enumeration specifies a set of cost levels and cost flags supported
in Windows 8 Cost APIs.
NLM_CONNECTION_PROPERTY_CHANGE
NLM_CONNECTIVITY
NLM_DOMAIN_AUTHENTICATION_KIND
NLM_DOMAIN_TYPE
The NLM_DOMAIN_TYPE enumeration is a set of flags that specify the domain type of a network.
NLM_ENUM_NETWORK
The NLM_ENUM_NETWORK enumeration contains a set of flags that specify what types of
networks are enumerated.
NLM_INTERNET_CONNECTIVITY
NLM_NETWORK_CATEGORY
The NLM_NETWORK_CATEGORY enumeration is a set of flags that specify the category type of a
network.
NLM_NETWORK_CLASS
NLM_NETWORK_CLASS enumeration defines a set of flags that specify if a network has been
identified.
NLM_NETWORK_PROPERTY_CHANGE
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The IEnumNetworkConnections interface inherits from the IUnknown interface.
IEnumNetworkConnections also has these types of members:
Methods
The IEnumNetworkConnections interface has these methods.
IEnumNetworkConnections::Clone
The Clone method creates an enumerator that contains the same enumeration state as the
enumerator currently in use. (IEnumNetworkConnections.Clone)
IEnumNetworkConnections::get__NewEnum
The get_NewEnum property returns an automation enumerator object that you can use to iterate
through the IEnumNetworkConnections collection.
IEnumNetworkConnections::Next
The Next method gets the next specified number of elements in the enumeration sequence.
(IEnumNetworkConnections.Next)
IEnumNetworkConnections::Reset
IEnumNetworkConnections::Skip
The Skip method skips over the next specified number of elements in the enumeration sequence.
(IEnumNetworkConnections.Skip)
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
The Clone method creates an enumerator that contains the same enumeration state as
the enumerator currently in use.
Syntax
C++
HRESULT Clone(
[out] IEnumNetworkConnections **ppEnumNetwork
);
Parameters
[out] ppEnumNetwork
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworkConnections
Feedback
Was this page helpful? ツ Yes ト No
The get_NewEnum property returns an automation enumerator object that you can use
to iterate through the IEnumNetworkConnections collection.
Syntax
C++
HRESULT get__NewEnum(
[out] IEnumVARIANT **ppEnumVar
);
Parameters
[out] ppEnumVar
Return value
Returns S_OK if the method succeeds.
Remarks
In Microsoft Visual Basic and Microsoft C#, you do not need to use the corresponding
_NewEnum property, because it is automatically used in the implementation of the For
Each loop (for each in Visual C#).
Requirements
Header netlistmgr.h
See also
IEnumNetworkConnections
Feedback
Was this page helpful? ツ Yes ト No
The Next method gets the next specified number of elements in the enumeration
sequence.
Syntax
C++
HRESULT Next(
[in] ULONG celt,
[out] INetworkConnection **rgelt,
[out] ULONG *pceltFetched
);
Parameters
[in] celt
[out] rgelt
[out] pceltFetched
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworkConnections
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT Reset();
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworkConnections
Feedback
Was this page helpful? ツ Yes ト No
The Skip method skips over the next specified number of elements in the enumeration
sequence.
Syntax
C++
HRESULT Skip(
[in] ULONG celt
);
Parameters
[in] celt
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworkConnections
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The IEnumNetworks interface inherits from the IUnknown interface. IEnumNetworks
also has these types of members:
Methods
The IEnumNetworks interface has these methods.
IEnumNetworks::Clone
The Clone method creates an enumerator that contains the same enumeration state as the
enumerator currently in use. (IEnumNetworks.Clone)
IEnumNetworks::get__NewEnum
The get_NewEnum property returns an automation enumerator object that you can use to iterate
through the IEnumNetworks collection.
IEnumNetworks::Next
The Next method gets the next specified number of elements in the enumeration sequence.
(IEnumNetworks.Next)
IEnumNetworks::Reset
The Reset method resets the enumeration sequence to the beginning. (IEnumNetworks.Reset)
IEnumNetworks::Skip
The Skip method skips over the next specified number of elements in the enumeration sequence.
(IEnumNetworks.Skip)
Remarks
The list of connected or disconnected networks is cached by IEnumNetworks when it is
instantiated. This list is not updated when the connectivity state of a network changes.
The INetwork interface is recommended for retrieving the current connectivity state of a
network.
Requirements
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
The Clone method creates an enumerator that contains the same enumeration state as
the enumerator currently in use.
Syntax
C++
HRESULT Clone(
[out] IEnumNetworks **ppEnumNetwork
);
Parameters
[out] ppEnumNetwork
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
IEnumNetworks
Feedback
Was this page helpful? ツ Yes ト No
The get_NewEnum property returns an automation enumerator object that you can use
to iterate through the IEnumNetworks collection.
Syntax
C++
HRESULT get__NewEnum(
[out] IEnumVARIANT **ppEnumVar
);
Parameters
[out] ppEnumVar
Return value
Returns S_OK if the method succeeds.
Remarks
In Microsoft Visual Basic and Microsoft C#, you do not need to use the corresponding
_NewEnum property, because it is automatically used in the implementation of the For
Each loop (for each in Visual C#).
Requirements
Header netlistmgr.h
See also
IEnumNetworks
Feedback
Was this page helpful? ツ Yes ト No
The Next method gets the next specified number of elements in the enumeration
sequence.
Syntax
C++
HRESULT Next(
[in] ULONG celt,
[out] INetwork **rgelt,
[out] ULONG *pceltFetched
);
Parameters
[in] celt
[out] rgelt
[out] pceltFetched
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworks
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT Reset();
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworks
Feedback
Was this page helpful? ツ Yes ト No
The Skip method skips over the next specified number of elements in the enumeration
sequence.
Syntax
C++
HRESULT Skip(
[in] ULONG celt
);
Parameters
[in] celt
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
IEnumNetworks
Feedback
Was this page helpful? ツ Yes ト No
The INetwork interface represents a network on the local machine. It can also represent a collection
of network connections with a similar network signature.
Inheritance
The INetwork interface inherits from the IUnknown interface. INetwork also has these types of
members:
Methods
The INetwork interface has these methods.
INetwork::get_IsConnected
The get_IsConnected property specifies if the network has any network connectivity.
INetwork::get_IsConnectedToInternet
INetwork::GetCategory
INetwork::GetConnectivity
INetwork::GetDescription
INetwork::GetDomainType
INetwork::GetName
INetwork::GetNetworkConnections
The GetNetworkConnections method returns an enumeration of all network connections for a network. A
network can have multiple connections to it from different interfaces or different links from the same interface.
INetwork::GetNetworkId
INetwork::GetTimeCreatedAndConnected
The GetTimeCreatedAndConnected method returns the local date and time when the network was created and
connected.
INetwork::SetCategory
The SetCategory method sets the category of a network. Changes made take effect immediately. Callers of this
API must be members of the Administrators group.
INetwork::SetDescription
INetwork::SetName
Remarks
The COM Object that implements INetwork also implements a property bag for additional properties.
To get access to this property bag you can use the INetwork interface and QueryInterface for
IPropertyBag. The property bag on this COM Object contains the following properties:
NA_NameSetByPolicy VT_BOOL The name of the network has been set by group
policy.
NA_IconSetByPolicy VT_BOOL The icon of the network has been set by group
policy.
NA_CategorySetByPolicy VT_BOOL The category of the network has been set by group
policy.
Requirements
Feedback
Was this page helpful? ツ Yes ト No
The get_IsConnected property specifies if the network has any network connectivity.
Syntax
C++
HRESULT get_IsConnected(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT get_IsConnectedToInternet(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
If TRUE, this network has connectivity to the internet; if FALSE, it does not.
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetCategory(
[out] NLM_NETWORK_CATEGORY *pCategory
);
Parameters
[out] pCategory
Return value
Returns S_OK if the method succeeds.
Remarks
The private or public network categories must never be used to assume which Windows
Firewall ports are open, as the user can change the default settings of these categories.
Instead, Windows Firewall APIs should be called to ensure the ports that the required
ports are open.
Requirements
Header netlistmgr.h
See also
INetwork
NLM_NETWORK_CATEGORY
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetConnectivity(
[out] NLM_CONNECTIVITY *pConnectivity
);
Parameters
[out] pConnectivity
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetwork
NLM_CONNECTIVITY
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetDescription(
[out] BSTR *pszDescription
);
Parameters
[out] pszDescription
Pointer to a string that specifies the text description of the network. This value must be
freed using the SysFreeString API.
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetDomainType(
[out] NLM_DOMAIN_TYPE *pNetworkType
);
Parameters
[out] pNetworkType
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetName(
[out] BSTR *pszNetworkName
);
Parameters
[out] pszNetworkName
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns the following
value.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetNetworkConnections(
[out] IEnumNetworkConnections **ppEnumNetworkConnection
);
Parameters
[out] ppEnumNetworkConnection
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetNetworkId(
[out] GUID *pgdGuidNetworkId
);
Parameters
[out] pgdGuidNetworkId
Return value
Returns S_OK if the method succeeds.
Remarks
The caller is responsible for allocating the buffer pointed to by pgdGuidNetworkId. This
buffer must be large enough to hold a GUID.
Calling GetNetworkId will return S_OK even if the network requested has been deleted.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
The GetTimeCreatedAndConnected method returns the local date and time when the
network was created and connected.
Syntax
C++
HRESULT GetTimeCreatedAndConnected(
[out] DWORD *pdwLowDateTimeCreated,
[out] DWORD *pdwHighDateTimeCreated,
[out] DWORD *pdwLowDateTimeConnected,
[out] DWORD *pdwHighDateTimeConnected
);
Parameters
[out] pdwLowDateTimeCreated
Pointer to a datetime when the network was created. Specifically, it contains the low
DWORD of FILETIME.dwLowDateTime.
[out] pdwHighDateTimeCreated
Pointer to a datetime when the network was created. Specifically, it contains the high
DWORD of FILETIME.dwLowDateTime.
[out] pdwLowDateTimeConnected
Pointer to a datetime when the network was last connected to. Specifically, it contains
the low DWORD of FILETIME.dwLowDateTime.
[out] pdwHighDateTimeConnected
Pointer to a datetime when the network was last connected to. Specifically, it contains
the high DWORD of FILETIME.dwLowDateTime.
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
The SetCategory method sets the category of a network. Changes made take effect
immediately. Callers of this API must be members of the Administrators group.
Syntax
C++
HRESULT SetCategory(
[in] NLM_NETWORK_CATEGORY NewCategory
);
Parameters
[in] NewCategory
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT SetDescription(
[in] BSTR szDescription
);
Parameters
[in] szDescription
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Remarks
The maximum length for a network description is 1024 characters.
Requirements
Minimum supported client Windows Vista [desktop apps only]
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT SetName(
[in] BSTR szNetworkNewName
);
Parameters
[in] szNetworkNewName
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Remarks
The maximum length of a network name can be 128 characters and cannot contain
spaces only, tab or "\ /: * ? " < > |".
Requirements
Minimum supported client Windows Vista [desktop apps only]
Header netlistmgr.h
See also
INetwork
Feedback
Was this page helpful? ツ Yes ト No
The INetwork2 interface represents a network on the local machine. It can also
represent a collection of network connections with a similar network signature.
Inheritance
The INetwork2 interface derives from the INetwork interface.
Methods
The INetwork2 interface has these methods.
INetwork2::IsDomainAuthenticatedBy
Queries whether the specified domain authentication method succeeded for this network.
Remarks
See Remarks for INetwork.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Queries whether the specified domain authentication method succeeded for this
network.
Syntax
C++
HRESULT IsDomainAuthenticatedBy(
NLM_DOMAIN_AUTHENTICATION_KIND domainAuthenticationKind,
BOOL *pValue
);
Parameters
domainAuthenticationKind
pValue
The function dereferences pValue, and assigns TRUE if this network has the same
domain authentication kind as that specified in the domainAuthenticationKind
parameter; or FALSE if this network has a different domain authentication kind from that
specified in domainAuthenticationKind.
Return value
Returns S_OK if successful.
Example
In this example, a hypothetical networking diagnostic tool seeks to ensure that
connections to a corporate network have correct authentication properties.
C++
void RunDiagnostics()
{
winrt::com_ptr<::INetworkListManager> nlm;
winrt::com_ptr<::IEnumNetworks> enumNetworks;
winrt::com_ptr<::INetwork> network;
ULONG numberOfNetworksEnumerated{ 0 };
winrt::check_hresult(::CoCreateInstance(CLSID_NetworkListManager,
nullptr, CLSCTX_ALL, IID_PPV_ARGS(&nlm)));
winrt::check_hresult(nlm->GetNetworks(NLM_ENUM_NETWORK_ALL,
enumNetworks.put()));
if (!isNotDomainAuthenticated)
{
if (!!isLdapAuthenticated)
{
LogToConsole(L"Network is domain authenticated via
LDAP", networkName);
}
if (!!isTlsAuthenticated)
{
LogToConsole(L"Network is domain authenticated via
TLS", networkName);
}
Requirements
Header netlistmgr.h
See also
INetworkConnection2::IsDomainAuthenticatedBy method
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkConnection interface inherits from the IUnknown interface.
INetworkConnection also has these types of members:
Methods
The INetworkConnection interface has these methods.
INetworkConnection::get_IsConnected
The get_IsConnected property specifies if the associated network connection has network
connectivity.
INetworkConnection::get_IsConnectedToInternet
INetworkConnection::GetAdapterId
The GetAdapterID method returns the ID of the network adapter used by this connection.
INetworkConnection::GetConnectionId
The GetConnectionID method returns the Connection ID associated with this network connection.
INetworkConnection::GetConnectivity
The GetConnectivity method returns the connectivity state of the network connection.
INetworkConnection::GetDomainType
The GetDomainType method returns the domain type of the network connection.
INetworkConnection::GetNetwork
The GetNetwork method returns the network associated with the connection.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT get_IsConnected(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT get_IsConnectedToInternet(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
If TRUE, this network connection has connectivity to the internet; if FALSE, it does not.
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
The GetAdapterID method returns the ID of the network adapter used by this
connection.
Syntax
C++
HRESULT GetAdapterId(
[out] GUID *pgdAdapterId
);
Parameters
[out] pgdAdapterId
Pointer to a GUID that specifies the adapter ID of the TCP/IP interface used by this
network connection.
Return value
Returns S_OK if the method succeeds.
Remarks
It is possible for multiple connections to have the same AdapterID.
Requirements
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
The GetConnectionID method returns the Connection ID associated with this network
connection.
Syntax
C++
HRESULT GetConnectionId(
[out] GUID *pgdConnectionId
);
Parameters
[out] pgdConnectionId
Pointer to a GUID that specifies the Connection ID associated with this network
connection.
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
The GetConnectivity method returns the connectivity state of the network connection.
Syntax
C++
HRESULT GetConnectivity(
[out] NLM_CONNECTIVITY *pConnectivity
);
Parameters
[out] pConnectivity
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
The GetDomainType method returns the domain type of the network connection.
Syntax
C++
HRESULT GetDomainType(
[out] NLM_DOMAIN_TYPE *pDomainType
);
Parameters
[out] pDomainType
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
The GetNetwork method returns the network associated with the connection.
Syntax
C++
HRESULT GetNetwork(
[out] INetwork **ppNetwork
);
Parameters
[out] ppNetwork
Pointer to a pointer that receives an INetwork interface instance that specifies the
network associated with the connection.
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnection
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkConnection2 interface derives from the INetworkConnection interface.
Methods
The INetworkConnection2 interface has these methods.
INetworkConnection2::IsDomainAuthenticatedBy
Queries whether the specified domain authentication method succeeded for this network
connection.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Queries whether the specified domain authentication method succeeded for this
network connection.
Syntax
C++
HRESULT IsDomainAuthenticatedBy(
NLM_DOMAIN_AUTHENTICATION_KIND domainAuthenticationKind,
BOOL *pValue
);
Parameters
domainAuthenticationKind
pValue
The function dereferences pValue, and assigns TRUE if this network connection has the
same domain authentication kind as that specified in the domainAuthenticationKind
parameter; or FALSE if this network connection has a different domain authentication
kind from that specified in domainAuthenticationKind.
Return value
Returns S_OK if successful.
Remarks
See Remarks for INetwork2::IsDomainAuthenticatedBy method.
Example
See Example for INetwork2::IsDomainAuthenticatedBy method.
Requirements
Header netlistmgr.h
See also
INetwork2::IsDomainAuthenticatedBy method
Feedback
Was this page helpful? ツ Yes ト No
Use this interface to query current network cost and data plan status associated with a
connection.
Inheritance
The INetworkConnectionCost interface inherits from the IUnknown interface.
INetworkConnectionCost also has these types of members:
Methods
The INetworkConnectionCost interface has these methods.
INetworkConnectionCost::GetCost
INetworkConnectionCost::GetDataPlanStatus
GetDataPlanStatus method retrieves the status of the data plan associated with a connection.
Requirements
Header netlistmgr.h
See also
IUnknown
Feedback
Was this page helpful? ツ Yes ト No
The GetCost method retrieves the network cost associated with a connection.
Syntax
C++
HRESULT GetCost(
[out] DWORD *pCost
);
Parameters
[out] pCost
A DWORD value that represents the network cost of the connection. The lowest 16 bits
represent the cost level and the highest 16 bits represent the cost flags. Possible values
are defined by the NLM_CONNECTION_COST enumeration.
Return value
Returns S_OK on success. Otherwise an HRESULT error code is returned. Possible values
include:
Requirements
Header netlistmgr.h
See also
INetworkConnectionCost
Feedback
Was this page helpful? ツ Yes ト No
The GetDataPlanStatus method retrieves the status of the data plan associated with a
connection.
Syntax
C++
HRESULT GetDataPlanStatus(
[out] NLM_DATAPLAN_STATUS *pDataPlanStatus
);
Parameters
[out] pDataPlanStatus
Return value
Returns S_OK on success. Otherwise, an HRESULT error code is returned. Possible values
include:
Requirements
Header netlistmgr.h
See also
INetworkConnectionCost
Feedback
Was this page helpful? ツ Yes ト No
Use this interface to notify an application of cost and data plan status change events for
a connection.
Inheritance
The INetworkConnectionCostEvents interface inherits from the IUnknown interface.
INetworkConnectionCostEvents also has these types of members:
Methods
The INetworkConnectionCostEvents interface has these methods.
INetworkConnectionCostEvents::ConnectionCostChanged
INetworkConnectionCostEvents::ConnectionDataPlanStatusChanged
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT ConnectionCostChanged(
[in] GUID connectionId,
[in] DWORD newCost
);
Parameters
[in] connectionId
A unique ID that identifies the connection on which the cost change event occurred.
[in] newCost
A DWORD value that represents the new cost of the connection. The lowest 16 bits
represent the cost level, and the highest 16 bits represent the flags. Possible values are
defined by the NLM_CONNECTION_COST enumeration.
Return value
This method returns S_OK on success.
Requirements
Header netlistmgr.h
See also
INetworkConnectionCostEvents
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT ConnectionDataPlanStatusChanged(
GUID connectionId
);
Parameters
connectionId
A unique ID that identifies the connection on which the data plan status change event
occurred.
Return value
This method returns S_OK on success.
Requirements
Header netlistmgr.h
See also
INetworkConnectionCostEvents
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkConnectionEvents interface inherits from the IUnknown interface.
INetworkConnectionEvents also has these types of members:
Methods
The INetworkConnectionEvents interface has these methods.
INetworkConnectionEvents::NetworkConnectionConnectivityChanged
INetworkConnectionEvents::NetworkConnectionPropertyChanged
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT NetworkConnectionConnectivityChanged(
[in] GUID connectionId,
[in] NLM_CONNECTIVITY newConnectivity
);
Parameters
[in] connectionId
A GUID that identifies the network connection on which the event occurred.
[in] newConnectivity
NLM_CONNECTIVITY enumeration value that specifies the new connectivity for this
network connection.
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnectionEvents
NLM_CONNECTIVITY
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT NetworkConnectionPropertyChanged(
[in] GUID connectionId,
[in] NLM_CONNECTION_PROPERTY_CHANGE flags
);
Parameters
[in] connectionId
A GUID that identifies the network connection on which the event occurred.
[in] flags
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkConnectionEvents
NLM_CONNECTION_PROPERTY_CHANGE
Feedback
Was this page helpful? ツ Yes ト No
Use this interface to query for machine-wide cost and data plan status information
associated with either a connection used for machine-wide Internet connectivity, or the
first-hop of routing to a specific destination on a connection. Additionally, this interface
enables applications to specify destination IP addresses to receive cost or data plan
status change notifications for.
Inheritance
The INetworkCostManager interface inherits from the IUnknown interface.
INetworkCostManager also has these types of members:
Methods
The INetworkCostManager interface has these methods.
INetworkCostManager::GetCost
GetCost method retrieves the current cost of either a machine-wide internet connection, or the
first-hop of routing to a specific destination on a connection.
INetworkCostManager::GetDataPlanStatus
GetDataPlanStatus retrieves the data plan status for either a machine-wide internet connection ,
or the first-hop of routing to a specific destination on a connection.
INetworkCostManager::SetDestinationAddresses
Requirements
Header netlistmgr.h
See also
INetworkCostManagerEvents
IUnknown
Feedback
Was this page helpful? ツ Yes ト No
The GetCost method retrieves the current cost of either a machine-wide internet
connection, or the first-hop of routing to a specific destination on a connection. If
destIPaddr is NULL, this method instead returns the cost of the network used for
machine-wide Internet connectivity.
Syntax
C++
HRESULT GetCost(
[out] DWORD *pCost,
[in] NLM_SOCKADDR *pDestIPAddr
);
Parameters
[out] pCost
A DWORD value that indicates the cost of the connection. The lowest 16 bits represent
the cost level, and the highest 16 bits represent the flags. Possible values are defined by
the NLM_CONNECTION_COST enumeration.
[in] pDestIPAddr
Return value
Returns S_OK on success, otherwise an HRESULT error code is returned.
Requirements
Header netlistmgr.h
See also
INetworkCostManager
NLM_SOCKADDR
Feedback
Was this page helpful? ツ Yes ト No
The GetDataPlanStatus retrieves the data plan status for either a machine-wide internet
connection , or the first-hop of routing to a specific destination on a connection. If an
IPv4/IPv6 address is not specified, this method returns the data plan status of the
connection used for machine-wide Internet connectivity.
Syntax
C++
HRESULT GetDataPlanStatus(
[out] NLM_DATAPLAN_STATUS *pDataPlanStatus,
[in] NLM_SOCKADDR *pDestIPAddr
);
Parameters
[out] pDataPlanStatus
[in] pDestIPAddr
Return value
Returns S_OK on success, otherwise an HRESULT error code is returned.
Requirements
Header netlistmgr.h
See also
INetworkCostManager
NLM_SOCKADDR
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT SetDestinationAddresses(
[in] UINT32 length,
[in] NLM_SOCKADDR *pDestIPAddrList,
VARIANT_BOOL bAppend
);
Parameters
[in] length
[in] pDestIPAddrList
bAppend
If true, pDestIPAddrList will be appended to the existing address list; otherwise the
existing list will be overwritten.
Return value
Returns S_OK on success, otherwise an HRESULT error code is returned.
Remarks
This method must be called before IConnectionPoint::Advise. Once
IConnectionPoint::Advise is called, this method will not complete successfully until last
sink calls IConnectionPoint::UnAdvise. However, this method can be called multiple
times prior to the call to IConnectionPoint::Advise.
Requirements
See also
IConnectionPoint::Advise
IConnectionPoint::UnAdvise
INetworkCostManager
Feedback
Was this page helpful? ツ Yes ト No
Use this interface to notify an application of machine-wide cost and data plan related
events.
Inheritance
The INetworkCostManagerEvents interface inherits from the IUnknown interface.
INetworkCostManagerEvents also has these types of members:
Methods
The INetworkCostManagerEvents interface has these methods.
INetworkCostManagerEvents::CostChanged
CostChanged method is called to indicates a cost change for either machine-wide Internet
connectivity, or the first-hop of routing to a specific destination on a connection.
INetworkCostManagerEvents::DataPlanStatusChanged
Requirements
Header netlistmgr.h
See also
IUnknown
Feedback
Was this page helpful? ツ Yes ト No
The CostChanged method is called to indicates a cost change for either machine-wide
Internet connectivity, or the first-hop of routing to a specific destination on a
connection.
Syntax
C++
HRESULT CostChanged(
[in] DWORD newCost,
[in] NLM_SOCKADDR *pDestAddr
);
Parameters
[in] newCost
A DWORD that represents the new cost of the connection. The lowest 16 bits represent
the cost level, and the highest 16 bits represent the flags. Possible values are defined by
the NLM_CONNECTION_COST enumeration.
[in] pDestAddr
Return value
Returns S_OK on success.
Requirements
Minimum supported client Windows 8 [desktop apps only]
Header netlistmgr.h
See also
INetworkCostManagerEvents
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT DataPlanStatusChanged(
NLM_SOCKADDR *pDestAddr
);
Parameters
pDestAddr
Return value
Returns S_OK on success.
Requirements
Header netlistmgr.h
See also
INetworkCostManagerEvents
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkEvents interface inherits from the IUnknown interface. INetworkEvents
also has these types of members:
Methods
The INetworkEvents interface has these methods.
INetworkEvents::NetworkAdded
The NetworkAdded method is called when a new network is added. The GUID of the new network
is provided.
INetworkEvents::NetworkConnectivityChanged
INetworkEvents::NetworkDeleted
INetworkEvents::NetworkPropertyChanged
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
The NetworkAdded method is called when a new network is added. The GUID of the
new network is provided.
Syntax
C++
HRESULT NetworkAdded(
[in] GUID networkId
);
Parameters
[in] networkId
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkEvents
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT NetworkConnectivityChanged(
[in] GUID networkId,
[in] NLM_CONNECTIVITY newConnectivity
);
Parameters
[in] networkId
[in] newConnectivity
Return value
Returns S_OK if the method succeeds.
Requirements
See also
INetworkEvents
NLM_CONNECTIVITY
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT NetworkDeleted(
[in] GUID networkId
);
Parameters
[in] networkId
GUID that contains the network ID of the network that was deleted.
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkEvents
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT NetworkPropertyChanged(
[in] GUID networkId,
[in] NLM_NETWORK_PROPERTY_CHANGE flags
);
Parameters
[in] networkId
[in] flags
Return value
Returns S_OK if the method succeeds.
Requirements
See also
INetworkEvents
NLM_NETWORK_PROPERTY_CHANGE
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkListManager interface inherits from the IDispatch interface.
INetworkListManager also has these types of members:
Methods
The INetworkListManager interface has these methods.
INetworkListManager::ClearSimulatedProfileInfo
Clears the connection profile values previously applied to the internet connection profile by
SetSimulatedProfileInfo. The next internet connection query, via GetInternetConnectionProfile, will
use system information.
INetworkListManager::get_IsConnected
The get_IsConnected property specifies if the local machine has network connectivity.
INetworkListManager::get_IsConnectedToInternet
The get_IsConnectedToInternet property specifies if the local machine has internet connectivity.
INetworkListManager::GetConnectivity
The GetConnectivity method returns the overall connectivity state of the machine.
INetworkListManager::GetNetwork
INetworkListManager::GetNetworkConnection
The GetNetworkConnections method enumerates a complete list of the network connections that
have been made.
INetworkListManager::GetNetworks
The GetNetworks method retrieves the list of networks available on the local machine.
INetworkListManager::SetSimulatedProfileInfo
The SetSimulatedProfileInfo method applies a specific set of connection profile values to the
internet connection profile in support of the simulation of specific metered internet connection
conditions.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Clears the connection profile values previously applied to the internet connection profile
by SetSimulatedProfileInfo. The next internet connection query, via
GetInternetConnectionProfile, will use system information.
Syntax
C++
HRESULT ClearSimulatedProfileInfo();
Return value
Returns S_OK on success.
Requirements
Header netlistmgr.h
See also
INetworkListManager
SetSimulatedProfileInfo
Feedback
Was this page helpful? ツ Yes ト No
The get_IsConnected property specifies if the local machine has network connectivity.
Syntax
C++
HRESULT get_IsConnected(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
If TRUE , the network has at least local connectivity via ipv4 or ipv6 or both. The network
may also have internet connectivity. Thus, the network is connected.
If FALSE, the network does not have local or internet connectivity. The network is not
connected.
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT get_IsConnectedToInternet(
[out] VARIANT_BOOL *pbIsConnected
);
Parameters
[out] pbIsConnected
Return value
Returns S_OK if successful.
Requirements
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
The GetConnectivity method returns the overall connectivity state of the machine.
Syntax
C++
HRESULT GetConnectivity(
[out] NLM_CONNECTIVITY *pConnectivity
);
Parameters
[out] pConnectivity
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetNetwork(
[in] GUID gdNetworkId,
[out] INetwork **ppNetwork
);
Parameters
[in] gdNetworkId
[out] ppNetwork
Pointer to a pointer that receives the INetwork interface instance for this network.
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Minimum supported client Windows Vista [desktop apps only]
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetNetworkConnection(
[in] GUID gdNetworkConnectionId,
[out, retval] INetworkConnection **ppNetworkConnection
);
Parameters
[in] gdNetworkConnectionId
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
INetworkConnection
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT GetNetworkConnections(
[out] IEnumNetworkConnections **ppEnum
);
Parameters
[out] ppEnum
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
The GetNetworks method retrieves the list of networks available on the local machine.
Syntax
C++
HRESULT GetNetworks(
[in] NLM_ENUM_NETWORK Flags,
[out] IEnumNetworks **ppEnumNetwork
);
Parameters
[in] Flags
NLM_ENUM_NETWORK enumeration value that specifies the flags for the network
(specifically, connected or not connected).
[out] ppEnumNetwork
Pointer to a pointer that receives an IEnumNetworks interface instance that contains the
enumerator for the list of available networks.
Return value
Returns S_OK if the method succeeds. Otherwise, the method returns one of the
following values.
Requirements
Minimum supported client Windows Vista [desktop apps only]
Header netlistmgr.h
See also
INetworkListManager
Feedback
Was this page helpful? ツ Yes ト No
The simulation only applies in an RDP Child Session and does not affect the primary user
session. The simulated internet connection profile is returned via the Windows Runtime
API GetInternetConnectionProfile.
Syntax
C++
HRESULT SetSimulatedProfileInfo(
NLM_SIMULATED_PROFILE_INFO *pSimulatedInfo
);
Parameters
pSimulatedInfo
Specific connection profile values to simulate on the current internet connection profile
when calling GetInternetConnectionProfile from an RDP Child Session
Return value
Returns S_OK on success.
Requirements
Header netlistmgr.h
See also
Child Sessions (Windows)
ClearSimulatedProfileInfo
INetworkListManager
NLM_SIMULATED_PROFILE_INFO
Feedback
Was this page helpful? ツ Yes ト No
Inheritance
The INetworkListManagerEvents interface inherits from the IUnknown interface.
INetworkListManagerEvents also has these types of members:
Methods
The INetworkListManagerEvents interface has these methods.
INetworkListManagerEvents::ConnectivityChanged
Requirements
Header netlistmgr.h
See also
NLM_CONNECTIVITY
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT ConnectivityChanged(
[in] NLM_CONNECTIVITY newConnectivity
);
Parameters
[in] newConnectivity
Return value
Returns S_OK if the method succeeds.
Requirements
Header netlistmgr.h
See also
INetworkListManagerEvents
NLM_CONNECTIVITY
Feedback
Was this page helpful? ツ Yes ト No
The NLM_CONNECTION_COST enumeration specifies a set of cost levels and cost flags
supported in Windows 8 Cost APIs.
Syntax
C++
Constants
NLM_CONNECTION_COST_UNKNOWN
Value: 0
The cost is unknown.
NLM_CONNECTION_COST_UNRESTRICTED
Value: 0x1
The connection is unlimited and is considered to be unrestricted of usage charges and capacity
constraints.
NLM_CONNECTION_COST_FIXED
Value: 0x2
The use of this connection is unrestricted up to a specific data transfer limit.
NLM_CONNECTION_COST_VARIABLE
Value: 0x4
This connection is regulated on a per byte basis.
NLM_CONNECTION_COST_OVERDATALIMIT
Value: 0x10000
The connection is currently in an OverDataLimit state as it has exceeded the carrier specified data
transfer limit.
NLM_CONNECTION_COST_CONGESTED
Value: 0x20000
The network is experiencing high traffic load and is congested.
NLM_CONNECTION_COST_ROAMING
Value: 0x40000
The connection is roaming outside the network and affiliates of the home provider.
NLM_CONNECTION_COST_APPROACHINGDATALIMIT
Value: 0x80000
The connection is approaching the data limit specified by the carrier.
Remarks
The value returned by the INetworkConnectionCost::GetCost method can have multiple
bits set with the values specified by this enumeration.
Requirements
Header netlistmgr.h
See also
INetworkConnectionCost::GetCost
Feedback
Was this page helpful? ツ Yes ト No
Get help at Microsoft Q&A
NLM_CONNECTION_PROPERTY_CHANG
E enumeration (netlistmgr.h)
Article01/31/2022
Syntax
C++
Constants
NLM_CONNECTION_PROPERTY_CHANGE_AUTHENTICATION
Value: 0x1
The Authentication (Domain Type) of this Network Connection has changed.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Constants
NLM_CONNECTIVITY_DISCONNECTED
Value: 0
The underlying network interfaces have no connectivity to any network.
NLM_CONNECTIVITY_IPV4_NOTRAFFIC
Value: 0x1
There is connectivity to a network, but the service cannot detect any IPv4 Network Traffic.
NLM_CONNECTIVITY_IPV6_NOTRAFFIC
Value: 0x2
There is connectivity to a network, but the service cannot detect any IPv6 Network Traffic.
NLM_CONNECTIVITY_IPV4_SUBNET
Value: 0x10
There is connectivity to the local subnet using the IPv4 protocol.
NLM_CONNECTIVITY_IPV4_LOCALNETWORK
Value: 0x20
There is connectivity to a routed network using the IPv4 protocol.
NLM_CONNECTIVITY_IPV4_INTERNET
Value: 0x40
There is connectivity to the Internet using the IPv4 protocol.
NLM_CONNECTIVITY_IPV6_SUBNET
Value: 0x100
There is connectivity to the local subnet using the IPv6 protocol.
NLM_CONNECTIVITY_IPV6_LOCALNETWORK
Value: 0x200
There is connectivity to a local network using the IPv6 protocol.
NLM_CONNECTIVITY_IPV6_INTERNET
Value: 0x400
There is connectivity to the Internet using the IPv6 protocol.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
The NLM_DATAPLAN_STATUS structure stores the current data plan status information
supplied by the carrier.
Syntax
C++
Members
InterfaceGuid
The unique ID of the interface associated with the data plan. This GUID is determined by
the system when a data plan is first used by a system connection.
UsageData
DataLimitInMegabytes
The data plan usage limit expressed in megabytes. If this value is not supplied, a default
value of NLM_UNKNOWN_DATAPLAN_STATUS is set.
InboundBandwidthInKbps
The maximum inbound connection bandwidth expressed in kbps. If this value is not
supplied, a default value of NLM_UNKNOWN_DATAPLAN_STATUS is set.
OutboundBandwidthInKbps
The maximum outbound connection bandwidth expressed in kbps. If this value is not
supplied, a default value of NLM_UNKNOWN_DATAPLAN_STATUS is set.
NextBillingCycle
The start time of the next billing cycle. If this value is not supplied, a default value of '0'
is set.
MaxTransferSizeInMegabytes
The maximum suggested transfer size for this network expressed in megabytes. If this
value is not supplied, a default value of NLM_UNKNOWN_DATAPLAN_STATUS is set.
Reserved
Requirements
Header netlistmgr.h
See also
INetworkConnectionCost::GetDataPlanStatus
INetworkCostManagerEvents::DataPlanStatusChanged
NLM_USAGE_DATA
Feedback
Was this page helpful? ツ Yes ト No
Only one of the listed constants is set for any instance of DomainAuthenticationKind. In
some scenarios, the constant set will represent the most preferred protocol used to
determine whether the domain was authenticated.
Syntax
C++
Constants
NLM_DOMAIN_AUTHENTICATION_KIND_NONE
Specifies no domain authentication method; and/or that the network couldn't be domain-
authenticated.
NLM_DOMAIN_AUTHENTICATION_KIND_LDAP
Specifies the domain authentication method for an Active Directory network; and/or that the
machine was successful in a Lightweight Directory Access Protocol (LDAP) authentication request
against the configured Active Directory servers on the current network.
NLM_DOMAIN_AUTHENTICATION_KIND_TLS
Specifies the Transport Layer Security (TLS) domain authentication method; and/or that the
network connection was able to successfully complete a HTTPS connection with verified TLS
authentication to an endpoint configured by the AllowedTlsAuthenticationEndpoints Mobile
Device Management (MDM) policy.
Requirements
Minimum supported client Windows 11 Build 22621
Header netlistmgr.h
See also
INetwork2::IsDomainAuthenticatedBy method
INetworkConnection2::IsDomainAuthenticatedBy method
Feedback
Was this page helpful? ツ Yes ト No
The NLM_DOMAIN_TYPE enumeration is a set of flags that specify the domain type of a
network.
Syntax
C++
Constants
NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK
Value: 0
The Network is not an Active Directory Network.
NLM_DOMAIN_TYPE_DOMAIN_NETWORK
Value: 0x1
The Network is an Active Directory Network, but this machine is not authenticated against it.
NLM_DOMAIN_TYPE_DOMAIN_AUTHENTICATED
Value: 0x2
The Network is an Active Directory Network, and this machine is authenticated against it.
Requirements
Feedback
Was this page helpful? ツ Yes ト No
The NLM_ENUM_NETWORK enumeration contains a set of flags that specify what types
of networks are enumerated.
Syntax
C++
Constants
NLM_ENUM_NETWORK_CONNECTED
Value: 0x1
Returns connected networks
NLM_ENUM_NETWORK_DISCONNECTED
Value: 0x2
Returns disconnected networks
NLM_ENUM_NETWORK_ALL
Value: 0x3
Returns connected and disconnected networks
Requirements
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Constants
NLM_INTERNET_CONNECTIVITY_WEBHIJACK
Value: 0x1
Indicates that the detected network is a hotspot. For example, when connected to a coffee Wi-Fi
hotspot network and the local HTTP traffic is being redirected to a captive portal, this flag will be
set.
NLM_INTERNET_CONNECTIVITY_PROXIED
Value: 0x2
Indicates that the detected network has a proxy configuration. For example, when connected to a
corporate network using a proxy for HTTP access, this flag will be set.
NLM_INTERNET_CONNECTIVITY_CORPORATE
Value: 0x4
Indicates that the machine is configured for Direct Access and that access to the corporate
domain network, for which Direct Access was previously configured, has been detected.
Remarks
These connectivity flags can be retrieved by querying for the NA_InternetConnectivityV4
or NA_InternetConnectivityV6 properties using the IPropertyBag interface for an
INetwork or INetworkConnection interface.
Requirements
Header netlistmgr.h
See also
INetwork
INetworkConnection
IPropertyBag
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Constants
NLM_NETWORK_CATEGORY_PUBLIC
Value: 0
The network is a public (untrusted) network.
NLM_NETWORK_CATEGORY_PRIVATE
Value: 0x1
The network is a private (trusted) network.
NLM_NETWORK_CATEGORY_DOMAIN_AUTHENTICATED
Value: 0x2
The network is authenticated against an Active Directory domain.
Remarks
The private or public network categories must never be used to assume which Windows
Firewall ports are open, as the user can change the default settings of these categories.
Instead, Firewall APIs should be called to ensure the ports that the required ports are
open.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Constants
NLM_NETWORK_IDENTIFYING
Value: 0x1
The network is being identified.
NLM_NETWORK_IDENTIFIED
Value: 0x2
The network has been identified.
NLM_NETWORK_UNIDENTIFIED
Value: 0x3
The network has not been identified.
Requirements
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Constants
NLM_NETWORK_PROPERTY_CHANGE_CONNECTION
Value: 0x1
A connection to this network has been added or removed.
NLM_NETWORK_PROPERTY_CHANGE_DESCRIPTION
Value: 0x2
The description of the network has changed.
NLM_NETWORK_PROPERTY_CHANGE_NAME
Value: 0x4
The name of the network has changed.
NLM_NETWORK_PROPERTY_CHANGE_ICON
Value: 0x8
NLM_NETWORK_PROPERTY_CHANGE_CATEGORY_VALUE
Value: 0x10
The category of the network has changed.
Requirements
Header netlistmgr.h
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Members
ProfileName[256]
cost
UsageInMegabytes
DataLimitInMegabytes
Requirements
Minimum supported client Windows 8.1 [desktop apps only]
Header netlistmgr.h
See also
Child Sessions (Windows)
ClearSimulatedProfileInfo
SetSimulatedProfileInfo
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Members
data[128]
Requirements
Header netlistmgr.h
See also
INetworkCostManager
INetworkCostManagerEvents
Feedback
Was this page helpful? ツ Yes ト No
The NLM_USAGE_DATA structure stores information that indicates the data usage of a
plan.
Syntax
C++
Members
UsageInMegabytes
LastSyncTime
The timestamp of last time synced with carriers about the data usage stored in this
structure.
Remarks
If usage is not supplied, UsageInMegabytes is set to
NLM_UNKNOWN_DATAPLAN_STATUS (0xFFFFFFFF), and LastSyncTime is set to 0.
Requirements
See also
INetworkCostManager::GetDataPlanStatus
NLM_DATAPLAN_STATUS
Feedback
Was this page helpful? ツ Yes ト No
This header is used by Network List Manager. For more information, see:
Functions
FreeInterfaceContextTable
This function frees the interface context table retrieved using the
GetInterfaceContextTableForHostName function.
GetInterfaceContextTableForHostName
This function retrieves an interface context table for the given hostname and connection profile
filter.
OnDemandGetRoutingHint
The OnDemandGetRoutingHint function looks up a destination in the Route Request cache and, if
a match is found, return the corresponding Interface ID.
OnDemandRegisterNotification
OnDemandUnRegisterNotification
Structures
NET_INTERFACE_CONTEXT
Feedback
Was this page helpful? ツ Yes ト No
This function frees the interface context table retrieved using the
GetInterfaceContextTableForHostName function.
Syntax
C++
void FreeInterfaceContextTable(
[in] NET_INTERFACE_CONTEXT_TABLE *InterfaceContextTable
);
Parameters
[in] InterfaceContextTable
Return value
None
Requirements
Header ondemandconnroutehelper.h
Library OnDemandConnRouteHelper.lib
DLL OnDemandConnRouteHelper.dll
See also
GetInterfaceContextTableForHostName
Feedback
Was this page helpful? ツ Yes ト No
This function retrieves an interface context table for the given hostname and connection
profile filter.
Syntax
C++
HRESULT GetInterfaceContextTableForHostName(
[in, optional] PCWSTR HostName,
[in, optional] PCWSTR ProxyName,
[in] DWORD Flags,
[in, optional] BYTE
*ConnectionProfileFilterRawData,
[in] DWORD
ConnectionProfileFilterRawDataSize,
[out] NET_INTERFACE_CONTEXT_TABLE **InterfaceContextTable
);
Parameters
[in, optional] HostName
[in] Flags
Flag Description
[in] ConnectionProfileFilterRawDataSize
[out] InterfaceContextTable
Return value
This function returns the following HRESULT values depending on the status.
HRESULT Description
S_OK This is returned if a connection that satisfies the parameters and internal
policies exists. NET_INTERFACE_CONTEXT_TABLE will contain a list of
interfaces indices and configuration names of those connections. When
S_OK is returned, FreeInterfaceContextTable should be called to release the
context table.
S_FALSE This is returned to indicate that any connection or default interface can be
used for this hostname and filter. The NET_INTERFACE_CONTEXT_TABLE will
be null in this case because the caller can use the default route to satisfy the
requirements.
E_OUTOFMEMORY This is returned if there is not enough memory to complete the operation.
FAILED(HRESULT) This is returned because of failures that are outside the control of this
function.
Requirements
Minimum supported client Windows 10 [desktop apps only]
Header ondemandconnroutehelper.h
Library OnDemandConnRouteHelper.lib
DLL OnDemandConnRouteHelper.dll
See also
FreeInterfaceContextTable
NET_INTERFACE_CONTEXT_TABLE
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Members
InterfaceIndex
ConfigurationName
Requirements
Header ondemandconnroutehelper.h
See also
GetInterfaceContextTableForHostName
NET_INTERFACE_CONTEXT_TABLE
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
Members
InterfaceContextHandle
NumberOfEntries
InterfaceContextArray
Requirements
Header ondemandconnroutehelper.h
See also
GetInterfaceContextTableForHostName
NET_INTERFACE_CONTEXT
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT OnDemandGetRoutingHint(
[in] PCWSTR destinationHostName,
[out] DWORD *interfaceIndex
);
Parameters
[in] destinationHostName
[out] interfaceIndex
The interface index of the network adapter to be used for communicating with the
target host.
Return value
This function returns the following to indicate operation results:
S_FALSE A match was not found in the dll cache for the specified
host name.
Requirements
Header ondemandconnroutehelper.h
Library OnDemandConnRouteHelper.lib
DLL OnDemandConnRouteHelper.dll
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT OnDemandRegisterNotification(
[in] ONDEMAND_NOTIFICATION_CALLBACK callback,
[in, optional] void *callbackContext,
[out] HANDLE *registrationHandle
);
Parameters
[in] callback
[out] registrationHandle
Return value
Returns S_OK on success.
Remarks
The ONDEMAND_NOTIFICATION_CALLBACK function is defined as:
syntax
Requirements
Header ondemandconnroutehelper.h
Library OnDemandConnRouteHelper.lib
DLL OnDemandConnRouteHelper.dll
See also
OnDemandUnregisterNotification
Feedback
Was this page helpful? ツ Yes ト No
Syntax
C++
HRESULT OnDemandUnRegisterNotification(
[in] HANDLE registrationHandle
);
Parameters
[in] registrationHandle
Return value
Returns S_OK on success.
Requirements
Header ondemandconnroutehelper.h
Library OnDemandConnRouteHelper.lib
DLL OnDemandConnRouteHelper.dll
See also
OnDemandRegisterNotification
Feedback
Was this page helpful? ツ Yes ト No