NSPGetServiceClassInfo function

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

Syntax


int WSAAPI NSPGetServiceClassInfo(
  _In_    LPGUID                 lpProviderId,
  _Inout_ LPDWORD                lpdwBufSize,
  _Inout_ LPWSASERVICECLASSINFOW lpServiceClassInfo
);

Parameters

lpProviderId [in]

A pointer to the GUID of the specific namespace provider from which the service class schema is to be retrieved.

lpdwBufSize [in, out]

On input, the size, in bytes, of the buffer pointed to by 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 the lpServiceClassInfo parameter needed to retrieve the record.

lpServiceClassInfo [in, out]

Returns a pointer to WSASERVICECLASSINFOW structure that contains the service class to namespace-specific mapping information. The lpServiceClassId parameter must be filled to indicate which WSASERVICECLASSINFOW record should be returned.

Return value

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

Error codeMeaning
WSA_NOT_ENOUGH_MEMORY

There is not enough memory available to perform this operation.

WSAEACCES

The calling routine does not have sufficient privileges to access the information.

WSAEFAULT

The buffer pointed to by the lpServiceClass parameter was too small to contain a WSASERVICECLASSINFOW structure. 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. 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.

WSATYPE_NOT_FOUND

The specified class was not found.

 

Remarks

The W2_32.dll uses this function to implement the WSAGetServiceClassNameByClassId function, as well as to retrieve the namespace-specific information passed to the NSPLookupServiceBegin and NSPSetService functions.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ws2spi.h

See also

NSPInstallServiceClass
NSPLookupServiceBegin
NSPRemoveServiceClass
WSAGetServiceClassInfo
WSAGetServiceClassNameByClassId
WSASERVICECLASSINFOW
WSASetLastError
NSPSetService

 

 

Show: