INetwork interface (netlistmgr.h)

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

The get_IsConnectedToInternet property specifies if the network has internet connectivity.
INetwork::GetCategory

The GetCategory method returns the category of a network.
INetwork::GetConnectivity

The GetConnectivity method returns the connectivity state of the network.
INetwork::GetDescription

The GetDescription method returns a description string for the network.
INetwork::GetDomainType

The GetDomainType method returns the domain type of a network.
INetwork::GetName

The GetName method returns the name of a network.
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

The GetNetworkId method returns the unique identifier of a network.
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

The SetDescription method sets or replaces the description for a network.
INetwork::SetName

The SetName method sets or renames a network.

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:

Parameter Type Description
NA_DomainAuthenticationFailed VT_BOOL Specifies that a domain network is not able to authenticate against the domain controller.
NA_NetworkClass NLM_NETWORK_CLASS value stored as VT_UINT Specifies the class of network. Possible values include:
  • NLM_NETWORK_IDENTIFYING (0x01)

    This is the special "Identifying" network. No properties on this network class can be changed.

  • NLM_NETWORK_IDENTIFIED (0x02)

    This is an Identified network.

  • NLM_NETWORK_UNIDENTIFIED (0x03)

    This is the special "Unidentified" network. The category of this network can be changed, but it will not persist when the network is disconnected.

NA_InternetConnectivityV4

or

NA_InternetConnectivityV6

NLM_INTERNET_CONNECTIVITY value stored as VT_UINT Provides details regarding IPv4 or IPv6 network connectivity. Possible values include:
  • NLM_INTERNET_CONNECTIVITY_WEBHIJACK (0x1)

    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 (0x2)

    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 (0x4)

    The machine has been configured for Direct Access and access is detected to the corporate domain network Direct Access has been configured for.

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_DescriptionSetByPolicy VT_BOOL The description of the network has been set by group policy.
NA_CategorySetByPolicy VT_BOOL The category of the network has been set by group policy.
NA_NameReadOnly VT_BOOL The name of the network is read only.
NA_IconReadOnly VT_BOOL The icon of the network is read only.
NA_DescriptionReadOnly VT_BOOL The description of the network is read only.
NA_CategoryReadOnly VT_BOOL The category of the network is read only.
NA_AllowMerge VT_BOOL The network can be merged with another network.
 

The IPropertyBag interface accepts LPCOLESTR as part of the IPropertyBag::Read and IPropertyBag::Write methods. For convenience, the string values for these properties are defined inside netlistmgr.h using the same names.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header netlistmgr.h