6.3  Configuring a WSH DLL

Two places in the registry must be set up with standardized configuration information for each WSH DLL:

1.Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Services\Winsock\Parameters
is a value entry of type REG_MULTI_SZ specifying a list of protocols (transport drivers) that each have a corresponding WSH DLL. The names stored in this list match the key names for the corresponding transport drivers under ..\CurrentControlSet\Services.

2.Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Services\
TransportDriverName\Parameters for each such transport driver is a Winsock subkey. Windows Sockets opens this key by forming a name string from the path to its own key under the Services key, the transport name specified in the list under ..Winsock\Parameters, and the transport's ..Parameters\Winsock key, which must contain the following value entries:

·Mapping — a REG_BINARY value that describes the address family, socket type, and protocol parameter triples supported by the WSH DLL. The format for this binary data is the WINSOCK_MAPPING structure, as defined in wsahelp.h.

·HelperDllName — a REG_EXPAND_SZ value that specifies the path to the WSH DLL itself.

·MinSockaddrLength — a REG_DWORD value that specifies the smallest valid SOCKADDR size, in bytes, for the WSH DLL.

·MaxSockaddrLength — a REG_DWORD value that specifies the largest valid SOCKADDR size, in bytes, for the WSH DLL.

Storing this information in two distinct places under ..\CurrentControlSet\Services helps to localize information about a transport driver under that driver's own Parameters key. The information under ..\Services\Winsock\Parameters provides a pointer to the actual information for each transport's WSH DLL, allowing setup programs to interoperate more easily.

The Windows NT setup utilities provide functions that perform most of the necessary work to set up WSH DDL registry information for a transport driver. These routines are AddWinsockInfo and RemoveWinsockInfo in the setup file utility.inf, which can be found in the WIndows NT system directory. A transport driver's installation script can call AddWinsockInfo, passing in the key name under Services of the transport driver, the full path name of the transport-specific WSH DLL, and the minimum and maximum SOCKADDR lengths. AddWinsockInfo then stores the standardized information already described in the registry.

For an example of a transport's call to this setup function, see oemnxptc.inf, the installation script for TCP/IP, also located in the Windows NT system directory.