Important The GetTypeByName 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 GetTypeByName function obtains a service type GUID for a network service specified by name.
INT GetTypeByName(
LPTSTR lpServiceName, // points to the name of the network service
PGUID lpServiceType // points to a variable to receive network
// service type
);
If the function succeeds, the return value is zero.
If the function fails, the return value is SOCKET_ERROR( – 1). To get extended error information, call GetLastError. GetLastError can return the following extended error value:
Value | Meaning |
---|---|
ERROR_SERVICE_DOES_NOT_EXIST | The specified service type is unknown. |
Windows NT: Yes
Windows CE: Unsupported.
Header: Declared in nspapi.h.
Import Library: Link with wsock32.lib.