WSAInstallServiceClassA 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 WSAInstallServiceClassA(
[in] LPWSASERVICECLASSINFOA 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 |
---|---|
The namespace provider cannot supply the requested class information. | |
There was insufficient memory to perform the operation. | |
The calling function does not have sufficient privileges to install the service. | |
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. | |
The service class information was not valid or improperly structured. This error is returned if the lpServiceClassInfo parameter is NULL. | |
The operation is not supported. This error is returned if the namespace provider does not implement this function. | |
The requested name 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 WSAInstallServiceClass 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 only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winsock2.h |
Library | Ws2_32.lib |
DLL | Ws2_32.dll |