Ordering of Device ID and Compatible Device ID Values

As described earlier, the compatible device ID (CID) for a printer provides the IDs of the other devices with which the printer is compatible. The operating system uses this information to load compatible device drivers, if necessary. There can be several CIDs for each logical device. The order in which these CIDs are listed in an INF file may be used by the operating system as a criteria for determining which driver to search for and load first.

The ordering scheme assigns a numeric rank value to each CID value and a driver with lower rank-order CID is considered by the operating system to be a better match for the device than a driver with a CID of higher-rank order. A driver with a CID with rank order of 0 is considered an exact match to the printer and when the driver identified by this CID is found it is automatically installed without prompting the user.

If a rank order 0 match is not found and a higher-order rank match is found, then the user is prompted with the information that a compatible device driver is available. At this point, the user is responsible for installing the most compatible driver available. If the user has a diskette with the rank order 0 driver on it, or some other driver the user believes is more compatible than the one found on the system and identified in the user dialog, then the user can insert that diskette and specify the driver to be installed from there. If the user does not have a more compatible driver on a diskette, the user may either OK the installation of the most compatible driver the system could find or select another printer driver from a list of printer drivers found by the system.

Note that there may be an extra step in the procedure previously described if the device being installed does not provide the information about what class of devices it belongs to. In that case, the user will be prompted to provide the device class and the procedure previously described will occur after the user responds that a printer is being installed.

Rank ordering is determined as follows:

  1. Assign device rank orders to the device IDs returned by the device. The device ID derived from the MFG and MDL key values returned by the device is assigned device rank order 0, the first CID returned by the device is assigned rank device order 1, the second CID returned by the device is assigned device rank order 2, and so on.
  2. The contents of the INF files on the host are searched for any matches with any of the device IDs returned by the device.
  3. Each time an exact match is found between a device ID in an INF file and a device ID returned by the device, an INF rank order is determined using the following rule: if the matching device ID in the INF file is the first one listed after the INF file Install section name, then the INF rank order is 0; if the matching device ID in the INF file is the second one listed after the Install section name, then the INF rank order is 1; and so on.
  4. After all the INF files are searched and all the matches are found and each match is assigned a device ID rank order and an INF file rank order, add the values of the two rank orders for each match.
  5. If this is the very first time the Windows 95 system has started up on this host, then automatically load the driver with the lowest-valued rank order sum without prompting the user. If this is not the very first time Windows 95 has started up, if one of the resulting rank order sums is 0, install that driver without prompting the user. Otherwise, prompt the user with the identity of the driver with the lowest-valued rank order sum and give the user a chance to provide a better matched driver on a diskette or select another printer from a list presented by the system. If the user does not provide a diskette, either the driver with the lowest-valued rank order is installed or the driver for the printer the user selects is installed.

For example, suppose an INF file on the host contains the following statements:

"Sample Printer 1" = X1.DRV,LPTENUM\Sample_Printer_CompaAAA2,Sample_Printer_CompaBBB2
"Sample Printer 2" = X2.DRV,LPTENUM\Sample_Printer_CompaCCC2,LPTENUM\Sample_Printer_CompaDDD2,Sample_Printer_CompaEEE2
 

And suppose the device returns the following Plug and Play device ID (derived from the MFG and MDL key values returned by the device as described in section Generating Unique Plug and Play Device IDs) and CIDs:

Device ID="LPTENUM\Sample_Printer_CompaCCC2"
CID=LPTENUM\Sample_Printer_CompaAAA2,Sample_Printer_CompaBBB2
 

The result of applying the matching and rank ordering rules to the preceding example is that Sample_Printer_2 has a device ID rank order of 0 and an INF rank order of 0, so the driver X2.DRV is automatically loaded without prompting the user.

For another example, suppose an INF file on the host contains the following statements:

"Sample Printer 1" = X1.DRV,LPTENUM\Sample_Printer_CompaAAA2,Sample_Printer_CompaBBB2
"Sample Printer 2" = X2.DRV,LPTENUM\Sample_Printer_CompaCCC2,LPTENUM\Sample_Printer_CompaDDD2,Sample_Printer_CompaEEE2
"Sample Printer 3" = X3.DRV,LPTENUM\Sample_Printer_CompaFFF2,LPTENUM\Sample_Printer_CompaGGG2,Sample_Printer_CompaHHH2
 

And suppose the device returns the following Plug and Play device ID (derived from the MFG and MDL key values returned by the device) and CIDs:

Device ID="LPTENUM\Sample_Printer_CompaDDD2"
CID=LPTENUM\Sample_Printer_CompaHHH2,Sample_Printer_CompaBBB2
 

The result of applying the matching and rank ordering rules to the preceding example is that there is no rank order 0 match found. Sample_Printer_2 (X2.DRV) has a rank order sum value of 1, Sample_Printer_1 (X1.DRV) has a rank order sum of 3, and Sample_Printer_3 (X3.DRV) has a rank order sum of 3.

If this is the very first time Windows 95 is run on the host, then X2.DRV is automatically installed without prompting the user. Otherwise, the user is prompted that X2.DRV will be installed as the printer driver unless the user inserts a diskette with a driver better matched to the printer (this diskette will probably have been provided by the printer vendor).