Platform SDK: Windows Sockets

Service Class Data Structures in the SPI

When a new service class is installed, a WSASERVICECLASSINFO structure must be prepared and supplied. This structure also consists of substructures that contain a series of parameters that apply to specific name spaces.

For each service class, there is a single WSASERVICECLASSINFO structure. Within the WSASERVICECLASSINFO structure, the service class's unique identifier is contained in lpServiceClassId, and an associated display string is referenced by lpServiceClassName.

The lpClassInfos member in the WSASERVICECLASSINFO structure references an array of WSANSCLASSINFO structures, each of which supplies a named and typed parameter that applies to a specified name space. Examples of values for the lpszName member include: SAPID, TCPPORT, UDPPORT, etc. These strings are generally specific to the name space identified in dwNameSpace. Typical values for dwValueType might be REG_DWORD, REG_SZ, etc. The dwValueSize member indicates the length of the data item pointed to by lpValue.

The entire collection of data represented in a WSASERVICECLASSINFO structure is provided to each name space provider via NSPInstallServiceClass. Each individual name space provider then sifts through the list of WSANSCLASSINFO structures and retain the information applicable to it. This architecture also envisions the future existence of a special name space provider that would retain all of the service class schema information for all of the name spaces. The Ws2_32.dll would query this provider to obtain the WSASERVICECLASSINFO data needed to supply to name space providers when NSPLookupServiceBegin is invoked to initiate a query, and when NSPSetService is invoked to register a service. Name space provider should not rely on this capability for the time being, and should instead have a provider-specific means to obtain any needed service class schema information. In the absence of a provider that stores all service class schema for all name spaces, the Ws2_32.dll will use NSPGetServiceClassInfo to obtain such information from each individual name space provider.