Platform SDK: Windows Networking |
The WNetGetProviderName function obtains the provider name for a specific type of network.
DWORD WNetGetProviderName( DWORD dwNetType, // network type LPTSTR lpProviderName, // provider name buffer LPDWORD lpBufferSize // size of buffer );
You can find a complete list of network types in the header file WinNetwk.h.
Windows 95/98: The size of the buffer is in bytes, not characters. Also, the buffer must be at least 1 byte long.
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_MORE_DATA | The buffer is too small to hold the network provider name. |
ERROR_NO_NETWORK | The network is unavailable. |
ERROR_INVALID_ADDRESS | The lpProviderName parameter or the lpBufferSize parameter is invalid. |
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.
Windows Networking (WNet) Overview, Windows Networking Functions, WNetGetResourceInformation, WNetGetNetworkInformation, WNetGetUniversalName