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:
Microsoft Windows 98
Microsoft Windows Me
Microsoft Windows 2000
Microsoft Windows XP
| Introduction | |
| USB Printing Overview | |
| FAQ for USB Printer Installation | |
| References |
Windows 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:
| • | Usbprint.sys handles kernel-mode operations such as power management on behalf of the high-level printer driver. |
| • | Usbprint.sys provides an interface very similar to that used by parallel printers, so it is possible for a single printer driver to work correctly on both USB and parallel port, without modification. |
| • | Usbprint.sys has been extensively tested with numerous printers, dongles, PCs, and mobile systems on the Windows 2000 and Windows XP operating systems. |
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.
This section presents a high-level overview of the components in the Microsoft USB printing solution.
The 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 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.
1. | The user connects a USB printer to the PC for the first time. |
2. | The kernel-mode USB print driver is loaded. |
3. | The high-level printer driver is installed. |
4. | The printer is fully installed and ready to print. |
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.
This 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:
| • | Use the ChkINF utility to validate the INFs for digital signature. |
| • | Check Signability on the Windows Quality Online Services web site when you submit your package. |
| • | Submit the INFs with your driver package to WHQL for testing and digital signature. For information, see Driver Signing for Windows. |
Installing USB Printing on Windows Me
To ensure that USB printers continue to work correctly when a user upgrades from Windows 98 to Windows Me, Usbprint.sys is supplied with the system but not automatically installed on Windows Me. This avoids any possible incompatibility with a vendor-supplied kernel-mode USB print driver that might already be installed on the user's system.
[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
This section describes a cross-platform printer INF that will install a USB or parallel printer driver on Windows XP, Windows 2000, and Windows Me.
[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"
This 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?
The two solutions might conflict with each other and interfere with successful printing on the user's system. The operating system cannot detect or prevent such conflicts. Vendors should use the Microsoft USB printing solution.
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?
Uninstall the vendor-supplied solution completely and then install the Microsoft solution. It should be possible for an update program to uninstall the vendor-supplied solution transparently, without requiring specific action on the part of the user. Update instructions should also be included in case the user wants to perform these steps manually.
If my company wants to use the Microsoft USB printing solution for Windows 98, what is the process for redistributing those files?
If you are requesting permission to redistribute these files for the first time, complete the USBPrint Redistribution License Request [43 KB]. If you are renewing your redistribution agreement, complete the USBPrint Redistribution License Renewal Request [46 KB]. Send your completed form to usbprdst@microsoft.com where your application will be reviewed for approval.
My company has a USB printing solution for Windows Me. What is the process for driver signing? What files do I have to submit?
Submit your entire driver package to WHQL for testing and digital signature, as described at Driver Signing for Windows.
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?
The printer will continue to work. The user will not have to reinstall the printer after upgrading.
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?
A driver's digital signature is generated from the complete set of binaries in the driver package. Adding files or changing existing files in the package invalidates the existing digital signature. The driver package must be resubmitted to WHQL for testing and a new digital signature.
| • | Install USB printer drivers on Windows operating systems as described in this article.
| ||||||||
| • | Use the following tools to prepare INFs for submission to WHQL.
| ||||||||
| • | Submit your driver package to WHQL for testing and digital signature.
| ||||||||
| • | Read about Windows printer drivers and USB printing.
| ||||||||
| • | Universal Serial Bus Device Class Definition for Printing Devices, available at: http://www.usb.org/developers/devclass_docs/, see under "Printer Class." |
| • | Redistribution Information Contact |
| • | Product Lifecycle Information |
| • |