Device File Name Indexes

In a special device file name, the index is the digit that follows the prefix. The index differentiates devices managed by a stream interface driver. By default, the Device Manager numbers indexes logically from 1 through 9, with 1 corresponding to the first device file name. If you require a tenth device file name, use 0 as the index.

If you need to number your device file names starting at an index other than 1, specify a starting index in a registry value called Index within the registry key for your driver. This is often necessary if your stream interface driver serves a device that should use a common prefix, such as COM. For example, on many Windows CE–based platforms, “COM1:”, “COM2:”, and “COM3:” correspond to built-in serial port hardware. If your driver is for a serial device, such as a packet-radio modem, it should appear as a COM port because modem software often assumes that modems are connected to COM ports. You could specify an Index value of 4 to differentiate your serial device from the ones built into the hardware.

If you specify an index, rather than letting the Device Manager assign indexes as needed, by default your driver supports only one device because the Device Manager can register only one device file name. If you need to specify an index but need more than one device file name, you have two options: the XXX_Init function can register additional device file names with the RegisterDevice function, or the setup utility can create additional sets of registry keys, each with a different index, when your driver is installed.