WSAGetServiceClassNameByClassId function
The WSAGetServiceClassNameByClassId function retrieves the name of the service associated with the specified type. This name is the generic service name, like FTP or SNA, and not the name of a specific instance of that service.
Syntax
INT WSAGetServiceClassNameByClassId( _In_ LPGUID lpServiceClassId, _Out_ LPTSTR lpszServiceClassName, _Inout_ LPDWORD lpdwBufferLength );
Parameters
- lpServiceClassId [in]
-
A pointer to the GUID for the service class.
- lpszServiceClassName [out]
-
A pointer to the service name.
- lpdwBufferLength [in, out]
-
On input, the length of the buffer returned by lpszServiceClassName, in characters. On output, the length of the service name copied into lpszServiceClassName, in characters.
Return value
The WSAGetServiceClassNameByClassId function returns a value of zero if successful. Otherwise, the value SOCKET_ERROR is returned, and a specific error number can be retrieved by calling WSAGetLastError.
| Error code | Meaning |
|---|---|
|
The lpServiceClassId parameter specified is invalid. | |
|
There was insufficient memory to perform the operation. | |
|
The calling routine does not have sufficient privileges to access the information. | |
|
The specified buffer pointed to by lpszServiceClassName is too small. Pass in a larger buffer. | |
|
No buffer space available. | |
|
The operation is not supported for the type of object referenced. This error is returned by some namespace providers that do not support getting service class information. | |
|
The lpServiceClassId is valid, but no data of the requested type was found. | |
|
The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions. |
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
WSAGetServiceClassNameByClassIdW (Unicode) and WSAGetServiceClassNameByClassIdA (ANSI) |
See also