Important The GetNameByType function is a Microsoft-specific extension to the Windows Sockets 1.1 specification. This function is obsolete. For the convenience of Windows Sockets 1.1 developers, the reference material is below.
The functions detailed in Protocol-Independent Name Resolution provide equivalent functionality in Windows Sockets 2.
The GetNameByType function obtains the name of a network service. The network service is specified by its service type.
INT GetNameByType(
  LPGUID lpServiceType,  // points to network service type GUID
  LPTSTR lpServiceName,  // points to buffer to receive name of 
                         // network service
  DWORD dwNameLength     // points to variable that specifies buffer 
                         // size
);
 If the function succeeds, the return value is not SOCKET_ERROR ( –1).
If the function fails, the return value is SOCKET_ERROR ( –1). To get extended error information, call GetLastError.
  Windows NT:  Yes
  Windows CE:  Unsupported.
  Header: Declared in nspapi.h.
  Import Library: Link with wsock32.lib.