Presentation is loading. Please wait.

Presentation is loading. Please wait.

Best Practices for Developing Printer Drivers Justin Hutchings Program Manager Microsoft Corporation Shawn Maloney Program Manager Microsoft Corporation.

Similar presentations


Presentation on theme: "Best Practices for Developing Printer Drivers Justin Hutchings Program Manager Microsoft Corporation Shawn Maloney Program Manager Microsoft Corporation."— Presentation transcript:

1

2 Best Practices for Developing Printer Drivers Justin Hutchings Program Manager Microsoft Corporation Shawn Maloney Program Manager Microsoft Corporation

3 Agenda Setup & Installation INFs PnP ranking for printers Installers/Co-installers Device Physical Configuration Performance Guidelines Reliability Guidelines Using Microsoft Core Components Security Guidelines Call To Action/Resources

4 Setup & Install – Multiple INFs Managing driver packages with multiple driver INFs Support for multifunction printers (MFPs) and core drivers Create individual driver subdirectories Use CopyINF command to preload drivers [MyMFPDevice.NTx86] CopyINF = \i386\ntprint.INF

5 Setup & Install - PnP Ranking for Printers Never list the same hardware ID twice in a single model section Never put hardware IDs for different devices on the same line Compatible IDs for a printer (new in Windows 7) always go in the 2nd position Hardware IDs on a line from most specific to least specific Device Name = Install_Section, HWID, CompatID “Fabrikam 6000” = InstallMe, USBPrint\Fabrikam6000, 1284_CID_FabrikamClass1

6 Setup & Install - Installers and Co-Installers Avoid version checks in the installer Use OS mechanisms for installing the driver Do not circumvent OS security and stability mechanisms Avoid hard dependencies between applications and drivers The use of co-installers is discouraged. Never perform essential installation functions in a co-installer.

7 Device Physical Configuration MFPs should enumerate all device functions (print, scan, fax, storage) on all available ports (USB, Ethernet, Wireless) “Maintenance ports” should be exclusively for maintenance Identical ports should expose the same functionality PictBridge and modem ports may vary, but should be marked clearly Installable options should be auto-configured

8 Performance Guidelines User interface (UI) Modules should use worker threads to maintain a responsive UI Filters in filter pipeline should flow from XPS document to stream Stream to XPS Document conversion is very costly XPS Document Filter 1 XPS Document Filter 2 XPS Stream Filter 3

9 Reliability Guidelines Power cycling is not an acceptable error mitigation Use Driver Isolation in Windows 7 Will protect the spooler from crashing drivers If you use COM, use only multithreaded apartment (MTA) threading in spooler processes Do not crash on unsupported escapes or fail print jobs Test with Print Verifier Will identify unsafe usage of spooler methods Validates reference counts, handles, COM interactions Helps with debugging PrintTicket/PrintCapabilities issues

10 Processor Architecture 64-bit OS adoption is at critical mass Print driver components must be built in the proper architecture Applications should be built in the proper architecture

11 Using Microsoft Core Components Unidrv & PostScript Use generic printer description (GPD) and PostScript printer description (PPD) files as the backbone of your driver They are simple, robust, backwards and forwards compatible, and have good performance Port monitors One of the most crash-prone, difficult components in the stack Custom port monitors are expensive to build and maintain USBMon and WSDMon are the preferred, supported port monitors and represent the best experience for customers WSDMon is a foundational piece in the Rally platform Microsoft is moving away from TCPMon– so should you

12 Security Guidelines User account control Test drivers as a limited user Store data only in the registry or in locations you control (not C:\Temp) Clean up data in any temporary folders on uninstall Data execution prevention (DEP) Protects our customers from viruses Do not disable DEP on the system or the application Do not mark data pages as executable Encrypt personally identifiable information Secure devices should be denial-of-service safe Clear unretrieved jobs Always accept new jobs

13 Call To Action Review your development and test processes and make needed changes Look for Best Practices Guide at WinHEC Provide feedback to prninfo@microsoft.comprninfo@microsoft.com

14 Additional Resources Blogs Print Verifier Team Blog: http://blogs.msdn.com/PrintVerifier http://blogs.msdn.com/PrintVerifier WDK Documentation Data Execution Prevention http://msdn.microsoft.com/en-us/library/aa366553.aspx http://msdn.microsoft.com/en-us/library/aa366553.aspx Updating Your Package-Aware Driver’s INF http://msdn.microsoft.com/en-us/library/cc678339.asp http://msdn.microsoft.com/en-us/library/cc678339.asp

15 Related Sessions SessionDay / Time Printer Installation and Driver ManagementMon. 9:45-10:45 and Tues. 2:45-3:45 Printer Driver Development in Windows 7Mon. 11-12 and Tues. 4-5 XPS Rasterization Service in Windows 7Mon. 1:30-2:30 and Tues. 5:15-6:15 Printer VerifierTues. 11-12 Printer Driver Testing ToolsTues. 9:45-10:45 and Wed. 8:30-9:30 Printer Driver Testing and the Windows Logo KitTues. 1:30-2:30 Printer Driver Development in Windows 7Mon. 11-12 and Tues. 4-5 Discussion: XPS Driver Development in Windows 7Mon. 4-5 and Wed. 1:30-2:30


Download ppt "Best Practices for Developing Printer Drivers Justin Hutchings Program Manager Microsoft Corporation Shawn Maloney Program Manager Microsoft Corporation."

Similar presentations


Ads by Google