Winsock Sections in a Network INF File

An INF file for a NetTrans component that provides a Winsock interface must specify this Winsock dependency. Such an INF file must contain a Winsock-install section. To create a Winsockinstall section, add the .Winsock extension to the DDInstall section name for the protocol. For example, if the DDInstall section for a protocol is named Ipx, the Winsock-install section for that protocol must be named Ipx.Winsock.

Note

Winsock dependency has been deprecated in Windows 8 and later.

A Winsock-install section must contain an AddSock directive. The AddSock directive specifies a vendor-named section that contains values to be added to the component's HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TransportDriverName\Params\Winsock key.

The vendor-named section referenced by the AddSock directive must contain the following required values:

Value Name Description

TransportService

A REG_SZ value that specifies the service name of the protocol. This must be the same as the Ndi\Service value for the protocol. For more information, see Adding Service-Related Values to the Ndi Key.

HelperDllName

A REG_EXPAND_SZ value that specifies the path to the Windows Sockets helper (WSH) DLL for the protocol. For more information, see WSH DLL Function Summary.

MaxSockAddrLength

A REG_DWORD value that specifies the largest valid SOCKADDR size, in bytes, for the WSH DLL

MinSockAddrLength

A REG_DWORD value that specifies the smallest valid SOCKADDR size, in bytes, for the WSH DLL

If an optional ProviderId for a namespace provider is specified, the following values must also be specified:

Value Name Description

ProviderId

A REG_SZ value that specifies the Globally Unique Identifier (GUID) that identifies the namespace provider. The GUID is used as a key to all subsequent references to the namespace provider. Obtain the GUID by running the uuidgen.exe utility. For more information about this utility, see the Microsoft Windows SDK.

LibraryPath

A REG_EXPAND_SZ value that specifies the complete path to the namespace provider DLL.

DisplayString

A localizable string that specifies the name displayed for the namespace provider in the user interface.

SupportedNameSpace

A REG_DWORD value which specifies the namespace that is supported by the namespace provider.

Version

An optional REG_DWORD value that specifies the version number of the namespace provider. If this value is not specified, the default value (1) is used for the version number.

The following namespace values can be assigned to SupportedNameSpace and are defined in Winsock2.h:

Namespace Value

NS_ALL

0

NS_SAP

1

NS_NDS

2

NS_PEER_BROWSE

3

NS_TCPIP_LOCAL

10

NS_TCPIP_HOSTS

11

NS_DNS

12

NS_NETBT

13

NS_WINS

14

NS_NBP

20

NS_MS

30

NS_STDA

31

NS_CAIRO

32

NS_X500

40

NS_NIS

41

NS_WRQ

50

For more information about namespace providers, see the Windows SDK documentation.

The following example shows Winsock sections for an IPX protocol:

[Ipx.Winsock]
AddSock = Install.IpxWinsock

[Install.IpxWinsock]
TransportService = nwlinkipx
HelperDllName = "%%SystemRoot%%\System32\wshisn.dll"
MaxSockAddrLength = 0x10
MinSockAddrLength = 0xe
ProviderId = "GUID"
LibraryPath = "%SystemRoot%\\System32\\nwprovau.dll"
DisplayString = %NwlnkIpx_Desc%
SupportedNameSpace = 1
Version = 2

An INF file can remove a Winsock dependency for a protocol by including a Winsock-remove section. To create a Winsock-remove section, add the .Winsock extension to the Remove section name for the protocol. For example, if the Remove section for a protocol is named Ipx.Remove, the Winsock-remove section for the protocol must be named Ipx.Remove.Winsock.

The Winsock-remove section contains a DelSock directive that specifies an INF-writer-named section. The INF-writer-named section must specify the transport service to remove. If a ProviderId was previously registered for the protocol, the vendor-named section must also specify the ProviderId to remove.

The following example shows two sections that remove the Winsock dependency for an IPX protocol:

[Ipx.Remove.Winsock]
DelSock = Remove.IpxWinsock

[Remove.IpxWinsock]
TransportService = nwlinkipx
ProviderId = "GUID"