WSAGetServiceClassNameByClassId
TOC
Collapse the table of content
Expand the table of content

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 codeMeaning
WSA_INVALID_PARAMETER

The lpServiceClassId parameter specified is invalid.

WSA_NOT_ENOUGH_MEMORY

There was insufficient memory to perform the operation.

WSAEACCES

The calling routine does not have sufficient privileges to access the information.

WSAEFAULT

The specified buffer pointed to by lpszServiceClassName is too small. Pass in a larger buffer.

WSAENOBUFS

No buffer space available.

WSAEOPNOTSUPP

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.

WSANO_DATA

The lpServiceClassId is valid, but no data of the requested type was found.

WSANOTINITIALISED

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

Winsock2.h

Library

Ws2_32.lib

DLL

Ws2_32.dll

Unicode and ANSI names

WSAGetServiceClassNameByClassIdW (Unicode) and WSAGetServiceClassNameByClassIdA (ANSI)

See also

Winsock Reference
Winsock Functions
WSAStartup

 

 

Show:
© 2016 Microsoft