WSAGetServiceClassNameByClassId The Windows Sockets WSAGetServiceClassNameByClassId function returns the name of the service associated with the given type. This name is the generic service name, like FTP or SNA, and not the name of a specific instance of that service.

INT WSAGetServiceClassNameByClassId(
  LPGUID lpServiceClassId,  
  LPTSTR lpszServiceClassName,  
  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. On output, the length of the service name copied into lpszServiceClassName.

Return Values

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 Codes

WSAEFAULT The specified buffer referenced by lpszServiceClassName is too small. Pass in a larger buffer.
WSA_INVALID_PARAMETER The lpServiceClassId parameter specified is invalid.
WSANOTINITIALIZED The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions.
WSA NOT ENOUGH MEMORY There was insufficient memory to perform the operation.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in winsock2.h.
  Import Library: Link with ws2_32.lib.