WSAGetServiceClassInfoW function (winsock2.h)

The WSAGetServiceClassInfo function retrieves the class information (schema) pertaining to a specified service class from a specified namespace provider.

Syntax

INT WSAAPI WSAGetServiceClassInfoW(
  [in]      LPGUID                 lpProviderId,
  [in]      LPGUID                 lpServiceClassId,
  [in, out] LPDWORD                lpdwBufSize,
  [out]     LPWSASERVICECLASSINFOW lpServiceClassInfo
);

Parameters

[in] lpProviderId

A pointer to a GUID that identifies a specific namespace provider.

[in] lpServiceClassId

A pointer to a GUID identifying the service class.

[in, out] lpdwBufSize

On input, the number of bytes contained in the buffer pointed to by the lpServiceClassInfo parameter.

On output, if the function fails and the error is WSAEFAULT, this parameter specifies the minimum size, in bytes, of the buffer pointed to lpServiceClassInfo needed to retrieve the record.

[out] lpServiceClassInfo

A pointer to a WSASERVICECLASSINFO structure that contains the service class information from the indicated namespace provider for the specified service class.

Return value

The return value is zero if the WSAGetServiceClassInfo was successful. Otherwise, the value SOCKET_ERROR is returned, and a specific error number can be retrieved by calling WSAGetLastError.

Error code Meaning
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 buffer pointed to by the lpServiceClassInfo parameter is too small to contain a WSASERVICECLASSINFOW. The application needs to pass in a larger buffer.
WSAEINVAL
The specified service class identifier or namespace provider identifier is not valid. This error is returned if the lpProviderId, lpServiceClassId, lpdwBufSize, or lpServiceClassInfo parameters are NULL.
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 requested name 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.
WSATYPE_NOT_FOUND
The specified class was not found.

Remarks

The WSAGetServiceClassInfo function retrieves service class information from a namespace provider. The service class information retrieved from a particular namespace provider might not be the complete set of class information that was specified when the service class was installed. Individual namespace providers are only required to retain service class information that is applicable to the namespaces that they support. See the section Service Class Data Structures for more information.

Note

The winsock2.h header defines WSAGetServiceClassInfo as an alias that 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 is 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

See also

Service Class Data Structures

WSAInstallServiceClass

WSASERVICECLASSINFOW

WSAStartup

Winsock Functions

Winsock Reference