Device Filename Indexes

The digit following the prefix in a special device filename is called the index. These are logically numbered from 1 to 9, with 1 corresponding to the first device filename, and then 0 if a tenth device filename is needed.

If necessary, you can provide a registry key to specify a starting index other than 1, although the Device Manager will use 1 by default for the first device filename. This is often necessary if your installable device driver is for a device that should use a common prefix, such as "COM". For example, on many Windows CE platforms, "COM1:", "COM2:", and "COM3:" correspond to built-in serial port hardware. If your driver were for a serial device such as a packet-radio modem, it would make sense for it to be exposed as another COM port so that communications software which expects to use a COM port will still work with your device. You could specify an index of 4 in the registry in order to differentiate your serial device from the ones built into the Windows CE platform.

Note that if you specify an index, that your driver will by default only be able to support 1 device, because Device Manager will only be able to register one device filename for you. If you need to specify an index and you need to drive more than one device, your xxx_Init function can register additional device filenames with the RegisterDevice function.