GetTypeByName Function
The GetTypeByName function retrieves a service type GUID for a network service specified by name.
Hinweis 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, this reference material is included. The functions detailed in Protocol-Independent Name Resolution provide equivalent functionality in Windows Sockets 2.
Syntax
INT GetTypeByName(
__in LPTSTR lpServiceName,
__inout PGUID lpServiceType
);
Parameter
lpServiceName [in]
A pointer to a zero-terminated string that uniquely represents the name of the service. For example, "MY SNA SERVER."lpServiceType [in, out]
A pointer to a variable to receive a globally unique identifier (GUID) that specifies the type of the network service. The Svcguid.h header file includes definitions of several GUID service types and macros for working with them.The Svcguid.h header file is not automatically included by the Winsock2.h header file.
Rückgabewert
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, which returns the following extended error value.
Value | Meaning |
---|---|
ERROR_SERVICE_DOES_NOT_EXIST | The specified service type is unknown. |
Anforderungen
Mindestens unterstützter Client |
Windows 2000 Professional |
Mindestens unterstützter Server |
Windows 2000 Server |
Header |
Nspapi.h |
Bibliothek |
Mswsock.lib |
DLL |
Mswsock.dll |
Unicode- und ANSI-Namen |
GetTypeByNameW (Unicode) and GetTypeByNameA (ANSI) |