WSAGetServiceClassInfo

The Windows Sockets WSAGetServiceClassInfo function retrieves all of the class information (schema) pertaining to a specified service class from a specified name space provider.

INT WSAGetServiceClassInfo(
  LPGUID lpProviderId,                      
  LPGUID lpServiceClassId,                  
  LPDWORD lpdwBufferLength,                 
  LPWSASERVICECLASSINFO lpServiceClassInfo  
);
 

Parameters

lpProviderId
[in] A pointer to a GUID that identifies a specific name space provider
lpServiceClassId
[in] A pointer to a GUID identifying the service class in question
lpdwBufferLength
[in/out] On input, the number of bytes contained in the buffer pointed to by lpServiceClassInfos. On output, if the function fails and the error is WSAEFAULT, then it contains the minimum number of bytes to pass for the lpServiceClassInfo to retrieve the record.
lpServiceClasslnfo
[out] A pointer to the service class information from the indicated name space provider for the specified service class.

Remarks

The WSAGetServiceClassInfo function retrieves service class information but the service class information retrieved from a particular name space provider might not be the complete set of class information that was supplied when the service class was installed. Individual name space providers are only required to retain service class information that is applicable to the name spaces that they support. See section Service Class Data Structures for more information.

Return Values

The return value is zero if the WSAGetServiceClassInfo was successful. Otherwise, the value SOCKET_ERROR is returned, and a specific error number can be retrieved by calling WSAGetLastError.

Error Codes

WSAEACCESS The calling routine does not have sufficient privileges to access the information.
WSAEFAULT The buffer referenced by lpServiceClassInfo is too small. Pass in a larger buffer.
WSAEINVAL the specified service class ID or name space provider ID is invalid.
WSANOTINITIALIZED The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions.
WSATYPE NOT FOUND The specified class was not found.
WSA NOT ENOUGH MEMORY There was insufficient memory to perform the operation.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in winsock2.h.
  Import Library: Link with ws2_32.lib.