Download presentation
Presentation is loading. Please wait.
Published byAbigayle Ray Modified over 9 years ago
2
Print Verifier Ashwin Needamangala Senior Test Development Lead Documents and Printing Team ashwinn@microsoft.com
3
Agenda Introduction to Print Verifier Using Print Verifier Setup and Configuration Demonstration Usage Recommendations Advanced Features Print Verifier Fault Detection Future Directions Call to Action
4
Driver Quality Challenges Print driver problems difficult to troubleshoot No print subsystem resource tracking Leaking print resources Using print resources in unsafe manner No print-specific tools that allow extended runtime checks Contracts between XPS filter and the Operating System (OS) Contracts between GDI driver and the OS Contracts between applications and the OS
5
Introduction to Print Verifier Designed to address many of the challenges Runtime verification tool Implemented as a DLL, injected early in each process Designed to catch violators in the act Flags errors via debugger breaks Supports both XPSDrv and GDI drivers Works per process Hooks the interfaces between 3 rd party code and OS code Ships as part of Application Verifier Available on microsoft.commicrosoft.com Well documented
6
High Level Architecture ApplicationsApplications Core Print Driver (unidrv, pscript, XPSDrv) Plug-in/XPSDrv Filter Spooler APIs Provided by: Microsoft ISV OEM Print Verifier (PrintAPI layer) Print Verifier (PrintDriver layer)
7
Print Verifier Philosophy 100% certainty when issuing a stop When in doubt, don’t stop in the debugger Print Verifier design is suitable for Windows Logo Kit testing Enabled in the next release of the Windows Logo Kit
8
Using Print Verifier Typical Workflow Install and enable Print Verifier for a process (for example, PrintFilterPipelineSvc.exe) Restart the process and start testing Driver violates an invariant at runtime For instance, over-releases an XPS filter interface pointer or uses invalid print ticket etc. Print Verifier immediately issues a debugger break (“verifier stop”) Look up documentation for the stop code and identify the bug
9
Setup and Configuration Part of Application Verifier MSI package Easy, scriptable and configurable install Once installed, can be enabled for each desired process For all verified processes, the presence of a debugger is required Known limitations System processes (csrss, lsass) not supported Application and Print Verifiers designed to verify native applications, not.NET applications It works, but provides limited value
10
Setup and Configuration
11
Recommended Settings Enable Basics, Print Driver and Print API layers for Spoolsv.exe (core print spooler service) PrintFilterPipelineSvc.exe (filter pipeline process) Splwow64.exe (thunk process for WoW64 printing) All test.EXEs you have
12
Print Verifier Demo
13
Additional Features Individual layers under “Printing” can be disabled Individual stops can be downgraded or disabled Print Ticket verification (PTConform) can be turned off All of the above are available from both App Verifier UI and command line
14
Additional Features Fault injection Available in both Print API and Print Driver layers FaultRate property controls rate of fault injection Logging Log is generated when a stop occurs during the verification of a driver Command line support to export logs to XML App Verifier UI has a link to Log Viewer
15
Print Verifier Fault Detection Print resource tracking Printer handles, printer change notification handles, PRINTER_NOTIFY_INFO, spool file handles, HPTPROVIDER handles Will issue a stop if the verified code is: Leaking any of the above print resources Using already closed handles Using unknown or uninitialized handles Using handles in a thread-unsafe manner
16
Print Verifier Fault Detection Invalid PrintTicket or PrintCapabilities objects crossing interface boundaries Application passing bad PrintTicket Driver/filter returning bad PrintTicket Incorrect interface reference counting XPS filters, plug-ins XPS filter making illegal call to the pipeline Example: Two IPrintWriteStream::Close calls Incorrect implementation of AsyncNotification interfaces
17
Print Verifier Fault Detection XPS filter changing/removing common property from the property bag XPS filter calling pipeline interface out of order Drivers/Filters causing structured exceptions Changing the security context in plug-in Bad DEVMODE buffer passed Illegal API call made in DllMain Driver/Filter calling ExitThread/TerminateThread Slow expensive operations performed by UI threads
18
Future Improvements Considering support for Print processors Port monitors Language monitors Monolithic drivers Verifying drivers accessing registry
19
Call To Action Get familiar with Application Verifier and Print Verifier Try out Print Verifier against your XPSDrv filters and GDI mini-drivers Integrate Print Verifier into your development and test environments Visit the Print Verifier blog Post questions to Print Verifier newsgroup Feature requests more than welcome!
20
Additional Resources Print Verifier Blog: http://blogs.msdn.com/PrintVerifierhttp://blogs.msdn.com/PrintVerifier Newsgroup on www.msdn.comwww.msdn.com Microsoft.public.win32.programmer.tools Tools Download Application Verifier: http://go.microsoft.com/fwlink/?LinkID=79601 http://go.microsoft.com/fwlink/?LinkID=79601 Application Verifier Documentation: http://msdn2.microsoft.com/en-us/library/aa480483.aspx http://msdn2.microsoft.com/en-us/library/aa480483.aspx Print Devices on the WHDC Web Site: http://www.microsoft.com/whdc/device/print/default.mspx http://www.microsoft.com/whdc/device/print/default.mspx XPS: http://www.microsoft.com/xpshttp://www.microsoft.com/xps Email: xpsinfo@microsoft.com and prninfo@microsoft.comxpsinfo@microsoft.comprninfo@microsoft.com
21
Related Sessions SessionDay / Time Best Practices for Developing Printer DriversMon. 8:30-9:30 and Tues. 8:30-9:30 Printer Installation and Driver ManagementMon. 9:45-10:45 and Tues. 2:45-3:45 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 XPS Rasterization ServicesMon. 1:30-2:30 and Tues. 5:15-6:15 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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.