The WNetGetProviderName function obtains the provider name for a specific type of network.
DWORD WNetGetProviderName(
DWORD dwNetType, // specifies network type
LPTSTR lpProvider, // pointer to buffer to receive provider name
LPDWORD lpBufferSize
// size of buffer
);
Windows 95: Size is in bytes, not characters. Also, the buffer must be at least 1 byte long.
If the function succeeds, the return value is WN_SUCCESS. If the function fails, one of the following errors will occur:
Value | Meaning |
---|---|
WN_MORE_DATA | The buffer is too small to hold the provider name. |
WN_NO_NETWORK | The network is not present. |
WN_BAD_POINTER | lpProvider or lpBufferSize is invalid. |
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Use version 2.0 or later.
Header: Declared in winnetwk.h.
Import Library: Use mpr.lib.
Windows Networking (WNet) Overview, Windows Networking Functions, WNetGetNetworkInformation