NETDI gets all of the driver-specific information for a driver or network component (referred to generically as NDI objects) either from the registry section for the driver or from a custom NDI installer procedure. The registry section for the object is initially populated based on the driver install section in the INF file.
Driver Sub Key | Value Name | Value | Description |
(null) | DriverDesc | driver description | A string that describes the driver. |
(null) | DevLoader | *ndis | A VxD that is the device loader for this node. The driver should be "*ndis" unless your device has a different device loader. |
(null) | DeviceVxD | driver list | A comma-separated list of VxDs. The drivers are loaded in the order listed. |
Driver Sub Key | Value Name | Value | Description |
Ndi | DeviceID | device ID | The device ID for this driver. |
Ndi | NdiInstaller | dllname,procname | The custom NDI procedure for this driver. The dllname is required; the default procname is NdiInstaller if none is specified. Note, this DLL must be copied in the registration section rather than the install section. (See below) |
Ndi | InfFile | filename | The InfFile value is maintained by NETDI and should not be specified in the INF file. |
Ndi | InfSection | section name | The InfSection value is maintained by NETDI and should not be specified in the INF file. |
Ndi | InstallInf | list of INFs | The list of INF files to add to the INF database when this component is selected. These INFs must be copied in the registration section. See Referring to other INFs below. |
If your component requires a custom NDI procedure DLL, this DLL must be copied before any of the other files are copied. This allows the DLL to display any custom UI before the user clicks the OK button in the Network Control Panel to cause NETDI to save the configuration. Furthermore, INF files that are not included with Windows 95 should copy themselves to the hard disk. To do this, copy the DLL and INFs by using a CopyFiles command in your registration section, as shown in the following example:
[MYDEVICE.ndi] AddReg=MYDEVICE.ndi.addreg CopyFiles=MYDEVICE.ndi.copyfiles,MYDEVICE.inf.copyfiles [MYDEVICE.ndi.addreg] HKR,Ndi,DeviceID,,MYDEVICE HKR,Ndi,Installer,,"MyNDI.DLL,MyNDIProc" ; ...other registration info... HKR,Ndi\Install,,,"MYDEVICE.Install" [MYDEVICE.ndi.copyfiles] MyNDI.DLL [MYDEVICE.inf.copyfiles] MyNDI.INF [MYDEVICE.Install] AddReg=MYDEVICE.Install.addreg CopyFiles=MYDEVICE.Install.copyfiles [MYDEVICE.Install.addreg] ; Registry keys needed to start this component [MYDEVICE.Install.copyfiles] [DestinationDirs] MYDEVICE.ndi.copyfiles = 11 ; System directory MYDEVICE.inf.coypfiles = 17 ; INF directory
Any network card that has a hardware enumerator (PCMCIA, EISA, PCI, ISAPNP, and so on) must have a special parameter set in the registration section to indicate that the card is a PnP card. The registration section for these cards should have a CardType parameter to indicate what the type of the card is:
Driver Sub Key | Value Name | Value | Description |
Ndi | CardType | cardtype | The type of the card: |
PCMCIA - for PCMCIA cards | |||
PNP - for PnP cards (as defined above) | |||
LEGACY - for other cards (default) | |||
Note: Cardtype=PCMCIA implies PNP. |
Statically loaded VxDs must also be stored in the HKLM\System\CurrentControlSet\Services\VxD\VXDNAME key, where VXDNAME is the name of the driver (usually the base name of the VxD file). Under this key, the following value must be set:
Driver Sub Key | Value Name | Value | Description |
(null) | StaticVxD | /driver list/ | A comma-separated list of VxDs that are loaded statically by the Configuration Manager. |
The Network Control Panel has an area on the bottom of the Configuration tab used to give the user a description of the selected object. By default, when the user selects an object, the help area simply displays a description of the class of the selected device. You can override this default and have the Network Control Panel display text specific to your device when the user selects it. This text is specified in the HelpText parameter:
Driver Sub Key | Value Name | Value | Description |
Ndi | HelpText | text to appear | This specifies the string to appear in the help text box when the user selects this device. |
This help text should be written to describe how the selected object benefits the user (such as, what can the user do with the object). For example, the help text for a client should not just say what the client is, but what it allows the user to connect to.
NETDI uses upper and lower interfaces to describe the possible relations between the layered drivers in the network system. The lower interface is the software or hardware interface that the driver talks to. For example, a network adapter driver might talk to "ethernet" or "tokenring." The upper interface is the software interface that the driver provides. For example, an NDIS 3.1 network adapter driver provides "ndis3" as an upper interface; an NDIS 3.1 transport driver has "ndis3" as a lower interface and might provide "netbios" or "ipx" as its upper interface.
The following interface names are predefined to cover the most common interfaces; however, any string of alphanumeric characters is a legal interface name. This allows you to create private interfaces between components. When defining your own interface, include the manufacturer name in the interface name to avoid conflicts with other vendors.
ethernet | lower edge for an ethernet network adapter |
tokenring | lower edge for a token ring network adapter |
serial | lower edge for a serial network adapter |
fddi | lower edge for an FDDI network adapter |
baseband | lower edge for a baseband network adapter |
broadband | lower edge for a broadband network adapter |
arcnet | lower edge for an ARCNET network adapter |
odi | ODI |
ndis2 | NDIS 2.1 |
ndis3 | NDIS 3.X |
netbios | NetBIOS |
ipx | IPX |
tdi | TDI interface to TCP/IP |
winsock | the Windows Sockets interface |
winnet31 | upper edge for a Windows 3.1 compatible WinNet driver |
multinet31 | upper edge for a Windows for Workgroups multi-network compatible WinNet driver |
winnet4 | upper edge for a Window 4.0 network provider |
NETDI matches the upper and lower interfaces of drivers to validate bindings between drivers. In addition, NETDI also checks for other required or excluded interfaces down the chain of bound driver and in the entire network subsystem. If an object has a lower edge that does not match the upper edge of any of the installed components, NETDI will attempt to install a component that does match the interface. For example, the Client for Windows Networks has a lower edge of NetBIOS. If the user tries to install this client without a NetBIOS protocol, NETDI will automatically install a protocol to match the required interface. In this case it would install NetBEUI.
The following list shows the registry entries for specifying interfaces requirements for a network driver. An interface list is a comma-separated list of interface names, for example, "ndis2, ndis3, odi".
Driver Sub Key | Value Name | Value | Description |
Ndi\Interfaces | DefUpper | interface list | These are the currently available upper interfaces. |
Ndi\Interfaces | DefLower | interface list | These are the currently available lower interfaces. |
Ndi\Interfaces | UpperRange | interface list | These are all possible upper interfaces. This value is maintained by NETDI and should not be set in an INF file. |
Ndi\Interfaces | LowerRange | interface list | These are all possible lower interfaces. This value is maintained by NETDI and should not be set in an INF file. |
Ndi\Interfaces | RequireAny | interface list | The driver requires that any driver in the system supports this interface. |
Ndi\Interfaces | ExcludeAny | interface list | The driver requires that no driver in the system supports this interface. |
The current upper and lower interfaces are queried in an NDI procedure by sending the appropriate NDI_GET_UPPER_INTERFACES and NDI_GET_LOWER_INTERFACES messages. The default NDI procedure reads the interface list from the registry. A custom NDI procedure can therefore enable or disable interfaces by returning a different interface list.
A driver can specify compatibility or incompatibility with other drivers in the system by specifying lists of device IDs. These can specify required or excluded devices. The following list shows the registry entries for specifying compatibility with other devices. A device is a Plug and Play device ID; a device list is a comma-separated list of device IDs. (Note that for non-hardware devices, the Plug and Play device ID is either the NDIS logical driver name or the base file name of the VxD or driver.)
Driver Sub Key | Value Name | Value | Description |
Ndi\Compatibility | RequireAll | device list | All of the devices in device list must be present in the network system. |
Ndi\Compatibility | RequireAny | device list | At least one of the devices in device list must be present in the network system. |
Ndi\Compatibility | ExcludeAll | device list | None of the device in device list can be present in the network system. |
Using the Ndi\Compatibility keys described above, it is possible for an INF to install other devices. These devices may be described in other INFs. To accomplish this, an INF must do the following:
For example, if MYDEVICE in Myndi.inf required OTHERDEVICE in Other.inf, MYNDI should look like the following:
[MYDEVICE.ndi] AddReg=MYDEVICE.ndi.addreg CopyFiles=MYDEVICE.ndi.copyfiles,MYDEVICE.inf.copyfiles [MYDEVICE.ndi.addreg] HKR,Ndi,DeviceID,,MYDEVICE HKR,Ndi,InstallInf,,"OTHER.INF" ; ...other registration info... HKR,Ndi\Install,,,"MYDEVICE.Install" [MYDEVICE.inf.copyfiles] MyNDI.INF OTHER.INF [MYDEVICE.Install] AddReg=MYDEVICE.Install.addreg CopyFiles=MYDEVICE.Install.copyfiles [MYDEVICE.Install.addreg] ; Registry keys needed to start this component [MYDEVICE.Install.copyfiles] [DestinationDirs] MYDEVICE.inf.copyfiles = 17 ; INF directory
When the driver is actually to be installed or removed, NETDI uses this information to tell which sections from the drivers INF files to execute. The install and remove entries can specify a base section that gets executed unconditionally whenever the driver is added or removed. The unconditional entries use the NULL value name. In addition, one can also specify interface-specific install and remove sections so only files or registrations that are a needed for the given upper interface are installed.
When installing, NETDI executes the base (null) section first, and then any interface-specific sections. When removing, NETDI executes interface-specific sections first and executes the base (null) section last.
Driver Sub Key | Value Name | Value | Description |
Ndi\Install | (null) | section name | Specifies the section name to execute for installing the driver. If this value exists, it is executed for all interfaces. |
Ndi\Install | interface name | section name | Specifies the section name to execute for installing the driver. It is only executed if interface name is among the current upper interfaces for the driver. |
Ndi\Remove | (null) | section name | Specifies the section name to execute for removing the driver. If this value exists, it is executed for all interfaces. |
Ndi\Remove | interface name | section name | Specifies the section name to execute for installing the driver. It is only executed if interface name is among the current upper interfaces for the driver. |
For NDIS3 network adapter drivers, hardware resources for the card memory base address, base I/O address, DMA channel, and IRQ level are specified by a Logical Configuration entry in the INF file. These Logical Configuration entries are documented in the Windows 95 Device Information Files specification.
NDIS2 network adapter drivers store hardware resources in the parameters section (described below). The parameter key must be the same as the one used in Protocol.ini.
Note: On computers, IRQ2 and IRQ9 are really the same. For this reason PnP always refers to IRQ2 as IRQ9. If the network adapter driver requires that a 2 be passed to it for IRQ2, it must set the IRQ2 parameter flag (described in the next section).
You can specify any number of software parameters to be saved under the driver's registry key. For NDIS2 drivers, these are also saved in PROTOCOL.INI. The parameter descriptions are saved under the "Ndi\params" subkey; their current values are saved at the root of the driver key. For NDIS drivers, the NDIS wrapper can read these parameters from the root of the driver key and report them back to the driver. The user views and edits the parameters from the "Advanced" property sheet page provided by NETDI. Parameters can be numeric (int, long, word, dword), or text (edit, enum). For numeric types, you can specify the minimum, maximum and, optionally, the interval value. For the enum type, you must specify a list of values and descriptions. For the edit type, you can specify certain edit control options: maximum length, OEM-text compatibility, and upper case.
Driver Sub Key | Value Name | Value | Description |
Ndi\Params\ParamKey | ParamDesc | string | Specifies the parameter description that will be shown in the "Advanced" dialog. |
Ndi\Params\ParamKey | Type | type | The parameter type. Can be: int, long, word, dword, enum, edit. The type is edit if type is not specified. |
Ndi\Params\ParamKey | Default | default value | Specifies the default value if no current value is specified. |
Ndi\Params\ParamKey | Optional | 0|1 | Marks the parameter as optional. An optional parameter can have no current value. The user can mark it as "Not Present" in the "Advanced" dialog. If Optional is not specified, the user must use the default value or supply a value the parameter. |
Range information for numeric types
Ndi\Params\ParamKey | Min | numeric value | The minimum value. |
Ndi\Params\ParamKey | Max | numeric value | The maximum value. |
Ndi\Params\ParamKey | Step | numeric value | The step between valid value, based from the minimum value. |
Ndi\Params\ParamKey | Base | 10|16 | Display and save values as decimal or hexadecimal. 10 if not specified. |
Range information for enum types
Ndi\Params\ParamKey\Enum value | description | A multiple value key. The value name is saved as the parameter value in the registry. The RHS value is shown to the user in dropdown listbox as the parameter value description. |
Hardware resource parameters for NDIS2 network card drivers:
Ndi\Params\ParamKey | resc | BYTE:1-4 | This binary value is required for all hardware resource parameters. It indicates what type of hardware resource the parameter represents: |
1 - Memory address | |||
2 - I/O Address | |||
3 - DMA channel | |||
4 - IRQ |
Use the following parameter to tell NETDI to store the parameter in some other location in the registry. Note, for this parameter, this will be the only value listed under Ndi\Params. The rest of the above parameters must be located in the desired registry key. (See the sessions parameter for NETBEUI listed in the example above.)
Storing parameters in an arbitrary registry location:
Ndi\Params\ParamKey | location | registry key | This tells NETDI what arbitrary registry key to store the value of this parameter. |
Parameter flags:
Ndi\Params\ParamKey | flag | BYTE:value | This binary DWORD value specifies flags for the parameter. The value is created by bitwise ORing the desired flags: |
0x10 - Used by NDIS2 only | |||
0x20 - Used by NDIS3 only | |||
0x40 - Card uses IRQ 2 | |||
0x08 - Required parameter (UI will force the user to set this value). | |||
Note: This parameter is written in the INF file as a DWORD using Intel(r) byte ordering. For example, 0x30 would be written in the INF file as "30,00,00,00". |
NETDI has the ability to search text files such as Autoexec.bat and Config.sys and insert or remove lines from them. It does this by using the following registry values in the registration section of your INF. The key name under the Ndi key is the name of the file to process. Each line to insert in this file is given a name (specified in the KeyOrder) value. For each line, you can insert or replace text in the file. Replacing a line with a null string effectively deletes the line.
NETDI executes these operations when it is committing changes to the disk.
Driver Sub Key | Value Name | Value | Description |
Ndi\filename\Order | KeyOrder | list of line names | This is a list of names (subkeys under Ndi\filename) to process and the order to process the lines in. |
Ndi\filename\name | Line | line to insert | This string is the line to insert according to the specified search rules. |
Ndi\filename\name | Search | search pattern | The pattern to search in the file. Line will be placed before or after this line (determined by Position below) For example, "*ndis*" searches for any line with "ndis" in it. |
Ndi\filename\name | Replace | replace string | Text to replace in the found line. For example, to replace "net start" with "net stop", set Search to "*net start*" and Replace to "*net stop*". |
Ndi\filename\name | Skip | search pattern | Do not process lines that match this pattern. |
Ndi\filename\name | Position | DWORD:position | Where to place the string in Line relative to the line found by the Search parameter: |
0 - insert at top of file or before the line | |||
1 - insert at end of file or after the line |
The NDIS 3 wrapper uses this information to load and bind NDIS 3.x drivers.
Driver Sub Key | Value Name | Value | Description |
NDIS | LogDriverName | driver name | The NDIS 3 driver's logical driver name. |
NDIS | MajorNdisVersion | BYTE:major | The NDIS major driver version. It is a byte HEX value: "03" for NDIS 3.X. (Not applicable for NDIS 2.X drivers.) |
NDIS | MinorNdisVersion | BYTE:minor | The NDIS driver version. It is a byte HEX value: "0A" for NDIS 3.1, "00" for NDIS 3.0. (Not applicable for NDIS 2 drivers.) |
The device loader and NDIS 3 wrapper use this information to check if the real-mode NDIS 2 driver is in memory and to load the appropriate mapper if necessary.
Driver Sub Key | Value Name | Value | Description |
NDIS/NDIS2 | DriverName | driver name | The NDIS 2 driver's base DriverName. |
NDIS/NDIS2 | AdapterName | adapter name | The NDIS 2 actual adapter name and Protocol.ini section name. The AdapterName changes for multiple instances of the adapter. |
NDIS/NDIS2 | FileName | driver file name | The name of the NDIS 2 driver. |
Note: NETDI automatically copies the file specified in FileName, therefore it is not necessary to explicitly copy the file in a CopyFiles section in the INF file. You only need a CopyFiles section for NDIS2 if you have additional support files for your driver.
The device loader and NDIS 3 wrapper use this information to check if the real-mode ODI driver is in memory and to load the appropriate mapper if necessary.
Driver Sub Key | Value Name | Value | Description |
NDIS/ODI | DriverName | LinkDriver name | The ODI driver's LinkDriver name and the NET.CFG section name. This can be a comma separated list of driver names if more than one MLID can support this card. If Setup finds one of these MLIDs loaded, it will use that MLID rather than the one specified in FileName below. |
NDIS/ODI | FileName | driver file name | The name of the primary ODI driver. (not a list) |
Note: NETDI automatically copies the file specified in FileName, therefore it is not necessary to explicitly copy the file in a CopyFiles section in the INF file. You only need a CopyFiles section for ODI if you have additional support files for your driver.
Since they specify information for hardware devices, INF files for network cards also need all the other information a standard PnP INF file needs. This includes using approved PnP device IDs and having LogConfig sections for non-PnP cards. LogConfig sections are not needed for PCMCIA, EISA, MCA, and PCI devices.