Compartir a través de


USB Host Printer Client Driver (Windows CE 5.0)

Send Feedback

The universal serial bus (USB) printer client driver is in the the %_WINCEROOT%\Public\Common\Oak\Drivers\USB\Class\Printer directory. The driver DLL is USBPRN.dll. Add the USB host printer client driver to your OS design from the Microsoft® Platform Builder Catalog or by setting SYSGEN_USB_PRINTER.

The USB printer client driver adheres to the USB host class device specifications. This driver provides a universal solution for printing on Microsoft Windows® CE operating systems through a USB port. The goal is to write the USB printer class driver as a transport driver that plugs into the existing print driver architecture.

For each USB printer attached to the USB bus, the USB class driver installs the sample PCL printer driver PCL.dll as the default printer driver. If your printer does not support PCL printing, modify the printer registry keys as described in the Windows CE printer documentation.

The USB printer class driver can support multiple printer devices. It presents each printer device as a single printer port to the system. The printer driver exposes the stream interface. For more information, see Stream Interface Drivers.

The following illustration shows the components of the USB printer class driver in the Windows CE driver architecture.

ms893782.usbprinter(en-us,MSDN.10).gif

For information about the USB specification or the USB printer class specification, see the USB Web site.

USB Host Printer Client Driver Interface

The USB printer class driver follows the standard Windows CE USB driver interface functions. The driver is implemented as a USB client driver and it exposes the USBInstallDriver, USBDeviceAttach, and USBUnInstallDriver entry points to support Plug-and-Play functionality.

The USB printer driver is a transport driver similar to the parallel port driver. This driver exposes the stream interface and uses the index LPT for its name. This parallel port interface is also implemented in the USB printer class driver. From the perspective of the Print Monitor on a Windows-based desktop computer, the USB printer driver is just another parallel port printer driver. To implement the USB host printer client driver interface, no changes are needed to the upper level printer architecture.

The USB host printer client driver supports the following IOCTLs, which are defined in Pegdpar.h:

  • IOCTL_PARALLEL_SET_TIMEOUTS
  • IOCTL_PARALLEL_GET_TIMEOUTS
  • IOCTL_PARALLEL_GETDEVICEID
  • IOCTL_PARALLEL_WRITE
  • IOCTL_PARALLEL_STATUS

The driver also supports any USB printer device that has the following key parameters in its USB_INTERFACE_DESCRIPTOR.

Parameter Value Description
bInterfaceClass 07 Base class for printers
bInterfaceSubClass 01 Printers
bInterfaceProtocol 01

02

Unidirectional interface

Default bidirectional interface

USB Host Printer Client Driver Limitations and Known Issues

The following list shows the limitations and known issues with the USB printer class driver:

  • Because Windows CE has only a PCL printer driver, the following registry key entry is hard-coded into the registry to load the PCL driver. This enables testing all USB printers that support PCL print format.

    HKEY_LOCAL_MACHINE\Printers\<IEEE_1284_Device_String>\Driver:"PCL.DLL"
    
  • Non-PCL printers still support ASCII-only printing with the default PCL driver.

    To support printing on non-PCL printers, you can load third-party printer drivers.

  • The USB printer driver uses a hard-coded LPT: value in the registry.

    Therefore, the printer driver shows up in Microsoft® WordPad for Windows CE word processing software with two LPT1: ports, even though Device Manager has only started one printer driver: the USB printer driver with the LPT1: name. The printer's IEEE_1284_Device_String appears correctly in WordPad, however.

See Also

Installing the USB Host Printer Client Driver on the Target Device

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.