Platform SDK: Windows Sockets

NSPGetServiceClassInfo

The NSPGetServiceClassInfo function retrieves all the pertinent class information (schema) pertaining to the name-space provider. This call retrieves any name space-specific information that is common to all instances of the service, including connection information for SAP, or port information for SAP or TCP.

int NSPGetServiceClassInfo (
  LPGUID                         lpProviderId,        
  OUT LPDWORD                    lpdwBufSize,         
  OUT LPWSASERVICECLASSINFOW     lpServiceClassInfo   
);

Parameters

lpProviderId
[in] Pointer to the GUID of the specific name-space provider from which the service class schema is to be retrieved.
lpdwBufSize
[in] Number of bytes contained in the buffer pointed to by lpServiceClassInfo on input. Alternately, if the function fails and the error is WSAEFAULT, lpdwBufSize contains the minimum number of bytes to pass for the lpServiceClassInfo to retrieve the record on output.
lpServiceClassInfo
[in] Returns service class to name space-specific mapping information. The lpServiceClassId parameter must be filled in to indicate which WSASERVICECLASSINFOW record should be returned.

Return Values

If no error occurs, the NSPGetServiceClassInfo function returns NO_ERROR (zero). Otherwise, SOCKET_ERROR (–1) is returned and it must set the appropriate error code using SetLastError.

Remarks

The W2_32.dll uses this function to implement the WSAGetServiceClassNameByClassId function, as well as to retrieve the name space specific information passed into the NSPLookupServiceBegin and NSPSetService.

Error Codes

Error code Meaning
WSAEACCES Calling routine does not have sufficient privileges to access the information.
WSAEFAULT The lpServiceClass buffer was too small to contain a WSASERVICECLASSINFOW.
WSAEINVAL Specified service class identifier or name-space–provider identifier is invalid.
WSATYPE_NOT_FOUND Specified class was not found in any of the name spaces.
WSA_NOT_ENOUGH_MEMORY Not enough free memory available to perform this operation.

Requirements

  Version: Requires Windows Sockets 2.0.
  Header: Declared in Ws2spi.h.