GetTypeByName function
The GetTypeByName function retrieves a service type GUID for a network service specified by name.
Syntax
INT GetTypeByName( _In_ LPTSTR lpServiceName, _Inout_ PGUID lpServiceType );
Parameters
- 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.
Return value
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 |
|---|---|
|
The specified service type is unknown. |
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
GetTypeByNameW (Unicode) and GetTypeByNameA (ANSI) |
See also