NSPGetServiceClassInfo

The NSPGetServiceClassInfo function retrieves all of 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 (
  IN    LPGUID lpProviderId,                            
  IN OUT    LPDWORD lpdwBufSize,                        
  IN OUT    LPWSASERVICECLASSINFOW lpServiceClassInfo   
);
 

Parameters

lpProviderId
A pointer to the GUID of the specific name space provider from which the service class schema is to be retrieved.
lpdwBufSize
The 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.
lpServiceClasslnfo
Returns service class to name space-specific mapping information. The lpServiceClassId field must be filled in to indicate which WSASERVICECLASSINFOW record should be returned.

Remarks

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

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.

Error Codes

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

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in ws2spi.h.