WNetGetNetworkInformationA function (winnetwk.h)

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

Syntax

DWORD WNetGetNetworkInformationA(
  [in]  LPCSTR          lpProvider,
  [out] LPNETINFOSTRUCT lpNetInfoStruct
);

Parameters

[in] lpProvider

Pointer to a constant null-terminated string that contains the name of the network provider for which information is required.

[out] lpNetInfoStruct

Pointer to a NETINFOSTRUCT structure. The structure describes characteristics of the network.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is a system error code, such as one of the following values.

Return code Description
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

Note

The winnetwk.h header defines WNetGetNetworkInformation as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winnetwk.h
Library Mpr.lib
DLL Mpr.dll

See also

NETINFOSTRUCT

NETRESOURCE

WNetEnumResource

WNetGetProviderName

WNetOpenEnum

Windows Networking (WNet) Overview

Windows Networking Functions