Profile Selection for Drivers That Do Not Support the New DeviceCapabilities Indices

If the driver does not return the manufacturer and model identifier to the DeviceCapabilities call, GDI constructs these from the (unfriendly) printer name (for example, the default printer name listed in the INF or the original dmDeviceName member of the DEVMODE structure, which the user may later change to a friendly name). The first four letters become the manufacturer identifier (that is, the icHeader.manufacturer tag). Spaces and hyphens are converted to spaces, and spaces are used to fill in afterward, if necessary. For example, "HP LaserJet" is read as "HP L" (0x48 0x50 0x32 0x4C), which is then converted to "HP " (0x48 0x50 0x32 0x32).

A CRC is applied to the whole name to get the model identifier (that is, the. icHeader.model tag). The CRC is given by the algorithm described at the end of this paper (which is actually the same algorithm used to construct parallel attached Plug and Play identifier values).