USB Printers - Architecture and Driver SupportUpdated: November 2, 2005
This paper describes guidelines and implementation requirements for supporting USB printers under current versions of Microsoft Windows operating systems. This information applies for the following operating systems: On This Page
IntroductionWindows 2000, Windows XP, and Windows Millennium Edition (Windows Me) supply a general kernel-mode USB print driver, Usbprint.sys, which works with the system-supplied port monitor Usbmon.dll to provide end-to-end connectivity between USB printers and high-level printer drivers. Together these components make up the Microsoft USB printing solution. Vendors are encouraged to write high-level printer drivers that rely on Usbprint.sys rather than writing their own kernel-mode USB print drivers. Usbprint.sys greatly simplifies the task of writing a high-level printer driver:
For maximum cross-platform compatibility, vendor-supplied printer drivers should not depend on proprietary device-control commands or any parallel port IOCTLs except for IOCTL_PAR_QUERY_DEVICE_ID. A printer driver that follows these guidelines can drive printers over both USB and parallel ports on Windows XP, Windows 2000, and Windows Me. The Windows DDK describes the procedures for writing a printer driver. If such a driver is correctly implemented as described in the DDK, the driver should "just work," because the printer driver installation mechanisms are the same on all three operating systems, over any bus. See the list of references at the end of this article for more information. Note: Usbprint.sys and Usbmon.dll work together to simplify the task of writing a vendor-supplied language monitor. If a language monitor uses only the WritePort, ReadPort, and IOCTL_PAR_QUERY_DEVICE_ID interfaces, it will be portable between USB and parallel ports. USB Printing OverviewThis section presents a high-level overview of the components in the Microsoft USB printing solution. USB and Parallel Print ArchitectureThe following figure shows the system-supplied and vendor-supplied components that can be involved in printing over USB and parallel ports on Windows operating systems. The only required vendor-supplied component is the high-level printer driver, which is layered above the spooler. A vendor can optionally supply a language monitor that is layered between the spooler and Usbmon.dll (for USB) or Localmon.dll (for parallel port). Windows USB and Parallel Port Printing Architecture
This figure shows a vendor-supplied kernel-mode USB print driver (labeled IHV-supplied USB Print Driver) layered above the USB driver stack. The USB driver stack consists of Usbhub.sys, Usbd.sys, and other layers underneath. The Windows 98 operating systems did not include an in-box kernel-mode USB print driver. Because of this, a vendor-supplied USB print driver was originally needed for USB printing. Microsoft has since made the USB printing solution available to vendors for redistribution with their printer drivers for the Windows 98 operating systems. The Microsoft USB printing solution for Windows 98 and Windows 98 Second Edition will be available for redistribution until June 30, 2007, after which time online self-help support may no longer be available, as described in the Product Lifecycle Policies. USB Printer Installation ProcessUSB printer installation varies slightly over Windows 2000, Windows XP, and Windows Me. This section describes the process and identifies the differences between the three operating systems in context of the general USB printer installation process.
For information about how Windows ranks drivers and selects the preferred driver to load, see "How Setup Selects Drivers" in the Windows DDK. This information also applies to Windows Me. Driver selection is also influenced by digital signature and the driver signing policy in effect on the system. For more information, see Driver Signing for Windows. INFs for Installing USB Printing on WindowsThis section presents two sample INF files that can be modified to install USB printing on Windows Me, Windows 2000, and Windows XP. Vendors should supply unique Plug and Play hardware IDs (VID/PID) for their devices and modify these examples as needed before including them in their driver packages. Vendors should also prepare INFs using the following steps before submitting their driver packages to WHQL for testing and digital signature:
Installing USB Printing on Windows Me
[Version]
Signature="$CHICAGO$"
Class=USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
Provider=%MSFT%
DriverVer=12/17/1999
CatalogFile=print9x.cat
[ControlFlags]
ExcludeFromSelect = *
[DestinationDirs]
DefaultDestDir = 10,system32\drivers
[Manufacturer]
%MSFT%=Microsoft
[Microsoft]
%USBPRINT.DeviceDesc% = USBPRINT_Inst,USB\Class_07
[USBPRINT_Inst]
Copyfiles = USBPRINT_Inst.CopyFiles
AddReg = USBPRINT.AddReg
DriverVer=12/17/1999
[USBPRINT_Inst.CopyFiles]
usbprint.sys,,,16
[USBPRINT.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,"usbprint.sys"
[SourceDisksNames]
1 = "USB disk",,,""
[SourceDisksFiles]
usbprint.sys = 1
[strings]
MSFT = "Microsoft"
USBPRINT.DeviceDesc = "USB Printing Support"
Writing a Cross-Platform INF to Install USB Printer Drivers
[Version]
Signature="$CHICAGO$"
Class=Printer
ClassGUID={4d36e979-e325-11ce-bfc1-08002be10318}
Provider=%MS%
CatalogFile=print9x.cat
CatalogFile.NT=print2K.cat
DriverVer=1/1/2000,4.00.2450.1
; The Manufacturer section lists all of the manufacturers that we will
; display in the Dialog box
[Manufacturer]
"Man"
[HP]
"Man printer" = DRIVER.DRV,MYPNPID
[DRIVER.DRV.NT]
; Windows 2000 printer driver installation entries go here.
[DRIVER.DRV]
; Windows 95/Me printer driver installation entries go here.
CopyFiles=@DRIVER.DRV,UNICLR,FINSTALL,MONITOR
DataSection=UNI_DATA
PortMonitor=usbmon.dll,usbmon.dll
DriverVer=1/1/2000,4.00.2450.1
[MONITOR]
usbmon.dll,,,16
[FINSTALL]
finstall.dll
finstall.hlp
[UNICLR]
iconlib.dll
dmcolor.dll
unidrv.dll
unidrv.hlp
[UNI_DATA]
HelpFile=unidrv.hlp
DefaultDataType=EMF
[DestinationDirs.NT]
DefaultDestDir=66000
[DestinationDirs]
DefaultDestDir=11
[SourceDisksNames.NT]
2 = %Disk2%,,,""
[SourceDisksNames]
1 = %Disk1%,,,""
[SourceDisksFiles.NT]
;NT files to install
[SourceDisksFiles]
printer.inf = 1
finstall.dll = 1
finstall.hlp = 1
driver.drv = 1
iconlib.dll = 1
dmcolor.dll = 1
unidrv.dll = 1
unidrv.hlp = 1
usbmon.dll = 1
[Strings]
MS="Microsoft"
Disk1="Win9x disk"
Disk2="Win2000 disk"
FAQ for USB Printer InstallationThis section provides answers to some frequently asked questions about USB printer drivers and installation. If a user has installed my company's USB printing solution for Windows Me, what happens if a second vendor's solution tries to load? If my company supplies a top-to-bottom USB printing solution for Windows 98 and Windows Me, what is the mechanism for upgrading to the Microsoft USB printing solution? If my company wants to use the Microsoft USB printing solution for Windows 98, what is the process for redistributing those files? My company has a USB printing solution for Windows Me. What is the process for driver signing? What files do I have to submit? If my company uses the Microsoft USB printing solution for Windows 98, what happens when the user upgrades to Windows Me, Windows 2000, or Windows XP? If my company wants to redistribute Usbprint.sys and Usbmon.dll for Windows 98, do I have to resubmit the driver package to WHQL for testing? ReferencesUsing Windows USB Print Drivers
Resources
|
|

