Generating Unique Plug and Play Device IDs

The Windows 95 parallel port enumerator (LPTENUM) generates a unique Plug and Play device ID by combining the MANUFACTURER and MODEL key values that are always returned by the device:

  1. The MANUFACTURER key value and MODEL key values are concatenated and a 4-digit checksum generated from the resulting string.
  2. After the checksum is generated, the concatenated string is truncated to 20 characters if necessary.
  3. The checksum is converted to a 4-character string and appended to the concatenated, and possibly truncated, string resulting in a device ID string of not more than 24 characters.

For example, if a printer MFG key value is Hewlett-Packard and the MDL key value is HP LaserJet 4P then the device ID that is generated is Hewlett-PackardHP_La7EE2. (The algorithm used to calculate the checksum is beyond the scope of this documentation.)

When LPTENUM\ is prepended to the device ID such as the one given in the preceding example, this is the device's Plug and Play ID value used by the Windows 95 parallel port enumerator. The example Plug and Play ID is LPTENUM\Hewlett-PackardHP_La7EE2.

The Plug and Play ID is used to search all known device information files (INF files) on a particular host for a driver that will support the device. The order in which device IDs are listed in the INF file is important in determining which device driver named in the INF file is the best match for the device. For examples of how to order the lists of device IDs in INF files, see the section Ordering of Device ID and Compatible Device ID Values.