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:
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).