LPNSPGETSERVICECLASSINFO callback function (ws2spi.h)
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
LPNSPGETSERVICECLASSINFO Lpnspgetserviceclassinfo;
INT Lpnspgetserviceclassinfo(
[in] LPGUID lpProviderId,
[in, out] LPDWORD lpdwBufSize,
[in, out] LPWSASERVICECLASSINFOW lpServiceClassInfo
)
{...}
Parameters
[in] lpProviderId
A pointer to the GUID of the specific namespace provider from which the service class schema is to be retrieved.
[in, out] lpdwBufSize
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.
[in, out] lpServiceClassInfo
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 code | Meaning |
---|---|
There is not enough memory available to perform this operation. | |
The calling routine does not have sufficient privileges to access the information. | |
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. | |
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**. | |
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 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
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | ws2spi.h |