When a miniport driver is installed on a Windows CE–based platform, the setup application should create several registry keys to expose the miniport driver to Windows CE properly. Windows CE loads NDIS drivers listed within the HKEY_LOCAL_MACHINE\Comm\ key. Subkeys within this key are named for the corresponding miniport driver.
The following table shows the subkeys contained in each Miniport\ key.
Name |
Type |
Description |
DisplayName | SZ | A user-friendly name for the driver. |
Group | SZ | The literal string “NDIS”. |
ImagePath | SZ | The name of the DLL containing the miniport driver. |
Linkage\Route | SZ | A set of Miniport Instance keys separated with commas. |
The value of the Linkage\Route key lists additional subkeys of the Comm\ key for each miniport instance. These subkeys in turn contain a set of keys that describes the parameters of that miniport instance. The following table shows the subkeys contained in each Miniport Instance key.
Name |
Type |
Description |
DisplayName | SZ | A user-friendly description of the miniport instance. |
Group | SZ | The literal value “NDIS”. |
ImagePath | SZ | The name of the miniport driver’s DLL. |
Parms | subkey | Subkeys for the miniport driver’s parameters. |
The following table shows the subkeys contained in each Miniport Instance\PARMS key.
Name |
Type |
Description |
BusNumber | DWORD | The bus number for the miniport instance. |
BusType | DWORD | The bus type of the miniport instance. |
BusNumber values range from 0 to one less than the number of buses on a Windows CE–based platform. Valid BusType values are declared in the _INTERFACE_TYPE enumeration in the Ceddk.h header file. Use the Miniport Instance\Parms key to store any miniport-specific values because this is the registry location accessed when miniport drivers call the NdisOpenConfiguration and NdisReadConfiguration functions.
The following example shows a set of registry keys for a miniport driver.
[HKEY_LOCAL_MACHINE\Comm]
[NE2000]
DisplayName="NE2000 Compatible Ethernet Driver"
Group ="NDIS"
ImagePath="NE2000.DLL"
[Linkage]
Route="NE20001, NE20002"
[NE20001]
DisplayName="NE2000 Compatible Ethernet Driver"
Group="NDIS"
ImagePath="NE2000.dll"
[Parms]
BusNumber=0
BusType=8
CardType=1
InterruptNumber=03
IOBaseAddress=0300
Transceiver=3
PC Card miniport drivers also require an HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Plug-and-Play ID\ registry key. This key enables the driver to load correctly when its NIC is inserted into a PC Card socket. The key typically is named for the Plug and Play identifier of the PC Card, but this is not a requirement. However, if the key is not named for the NIC’s Plug and Play identifier, the driver needs additional registry keys to enable the driver-detection algorithm of the Device Manager to load the driver. For more information on driver detection, see Drivers\PCMCIA\Detect.
The following table shows the subkeys contained in the HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Plug-and-Play ID\ key.
Name |
Type |
Description |
DLL | SZ | The literal string “Ndis.dll”. |
Prefix | SZ | The literal string “NDS”. |
Miniport | SZ | The name of the miniport driver for the PC Card, which corresponds to the name of the registry key within HKEY_LOCAL_MACHINE\Comm\ for the miniport driver. |
The example shows the additional keys that a PC Card network adapter could have.
[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\NICs-R-Us Inc.-Super2000-E6FE]
DLL="NDIS.DLL"
Prefix= "NDS"
Miniport="NE2000"
Ndis.dll sets values for the BusNumber and BusType keys for PC Card–based NICs. The BusNumber key contains the socket and function pair for the network adapter. The BusType key contains the value for the PC Card bus. Finally, if the card information structure (CIS) of the PC Card contains a network address value, Ndis.dll creates a \HKEY_LOCAL_MACHINE\Comm\Miniport Instance\Parms\NetworkAddress key to store the network address.
Protocol binding for miniport drivers for PC Card–based NICs occurs automatically when the driver is loaded. Protocol binding for miniport drivers for built-in NICs is controlled by the registry keys stored within HKEY_LOCAL_MACHINE\Comm\IrDA\Linkage\ and HKEY_LOCAL_MACHINE\Comm\Tcpip\Linkage\. Each of these Linkage\ keys should contain a single key called Bind. You can set the Bind key to a list of miniport instances that the corresponding protocol stack binds to. The following example shows the values that the registry could contain to enable the IrDA protocol stack to bind to the IrSIR miniport and the TCP/IP stack to bind to both the PPP and NE2000 miniports.
[HKEY_LOCAL_MACHINE\Comm]
[IrDA\Linkage]
Bind=multi_sz:"IrSir1"
[Tcpip\Linkage]
Bind=multi_sz: "PPP","NE20001"