WSAInstallServiceClassW function (winsock2.h)

The WSAInstallServiceClass function registers a service class schema within a namespace. This schema includes the class name, class identifier, and any namespace-specific information that is common to all instances of the service, such as the SAP identifier or object identifier.

Syntax

INT WSAAPI WSAInstallServiceClassW(
  [in] LPWSASERVICECLASSINFOW lpServiceClassInfo
);

Parameters

[in] lpServiceClassInfo

Service class to namespace specific–type mapping information. Multiple mappings can be handled at one time.

See the section Service Class Data Structures for a description of pertinent data structures.

Return value

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

Error code Meaning
WSA_INVALID_PARAMETER
The namespace provider cannot supply the requested class information.
WSA_NOT_ENOUGH_MEMORY
There was insufficient memory to perform the operation.
WSAEACCES
The calling function does not have sufficient privileges to install the service.
WSAEALREADY
Service class information has already been registered for this service class identifier. To modify service class information, first use WSARemoveServiceClass, and then reinstall with updated class information data.
WSAEINVAL
The service class information was not valid or improperly structured. This error is returned if the lpServiceClassInfo parameter is NULL.
WSAEOPNOTSUPP
The operation is not supported. This error is returned if the namespace provider does not implement this function.
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.

Remarks

Note

The winsock2.h header defines WSAInstallServiceClass 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 only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winsock2.h
Library Ws2_32.lib
DLL Ws2_32.dll

See also

WSAGetLastError

WSAGetServiceClassInfo

WSASERVICECLASSINFO

Winsock Functions

Winsock Reference