WSAGetServiceClassNameByClassIdW function (winsock2.h)
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 WSAAPI WSAGetServiceClassNameByClassIdW(
[in] LPGUID lpServiceClassId,
[out] LPWSTR lpszServiceClassName,
[in, out] LPDWORD lpdwBufferLength
);
Parameters
[in] lpServiceClassId
A pointer to the GUID for the service class.
[out] lpszServiceClassName
A pointer to the service name.
[in, out] lpdwBufferLength
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. |
Remarks
Note
The winsock2.h header defines WSAGetServiceClassNameByClassId as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps | UWP apps] |
Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
Target Platform | Windows |
Header | winsock2.h |
Library | Ws2_32.lib |
DLL | Ws2_32.dll |