Platform SDK: Windows Networking

WNetGetNetworkInformation

The WNetGetNetworkInformation function returns extended information about a specific network provider whose name was returned by a previous network enumeration.

DWORD WNetGetNetworkInformation(
  LPCTSTR lpProvider,              // provider name
  LPNETINFOSTRUCT lpNetInfoStruct  // network information
);

Parameters

lpProvider
[in] Pointer to a constant null-terminated string that contains the name of the network provider for which information is required.
lpNetInfoStruct
[out] Pointer to a NETINFOSTRUCT structure. The structure describes characteristics of the network.

Return Values

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_BAD_PROVIDER The lpProvider parameter does not match any running network provider.
ERROR_BAD_VALUE The cbStructure member of the NETINFOSTRUCT structure does not contain a valid structure size.

Remarks

For a code sample that illustrates an application-defined function that enumerates all the resources on a network, see Enumerating Network Resources.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winnetwk.h.
  Library: Use Mpr.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Windows Networking (WNet) Overview, Windows Networking Functions, WNetGetProviderName, NETINFOSTRUCT, NETRESOURCE, WNetOpenEnum, WNetEnumResource