Printer Driver Isolation in Windows 7 and Server 2008 R2
Helge Klein | 08.04.2009
If you are not tired of print spooler crashes then this article is not for you. If you are, you may find a new feature of the upcoming next version of Windows interesting: printer driver isolation.
Some BackgroundIn the dark ages of NT4 printer drivers were kernel drivers. From a reliability standpoint, that was a nightmare. Since printer drivers are not, have never been and probably will never be famous for stability, errors in printer driver code caused the computer to bug check (i.e. present the frustrated admin with a blue screen of death, BSOD). Windows 2000 brought the major improvement of so-called version 3 drivers which are executed in user mode (although, for compatibility reasons, version 2 kernel mode printer drivers can still be used even today). Version 3 drivers are implemented as DLLs which are loaded by the print spooler (spoolsv.exe) whenever a specific driver is required in order to process a print job. So far so good. Beginning with Windows 2000, buggy printer drivers do not bring down the entire machine, they "only" crash the spooler process. That may not be a big deal on single user systems, since the spooler is restarted automatically, but is a source for trouble on multi-user systems like terminal servers and on print servers. What often happens is this: a faulty printer driver crashes the spooler while processing a print job. The spooler is restarted and starts to pick up where it left off. The faulty driver gets a second go at the print job and crashes again. Seen from a user's perspective, the printing subsystem is unreliable. The only remedy is to pick printer drivers very, very carefully, ideally using only inbox drivers, i.e. drivers that ship with the operating system. But that is not always practical.
Improvements to the Spooler in Windows 7The logical consequence is to isolate printer drivers from each other and/or the spooler. Windows 7 and Server 2008 R2 achieve that by executing printer driver code not from within spoolsv.exe, but from a dedicated process, PrintIsolationHost.exe. In case of a driver causing a crash, only one instance of PrintIsolationHost.exe goes away, but the spooler service itself is left unperturbed. Printer driver isolation is enabled by default and can be disabled via the following group policy setting: Computer Configuration / Administrative Templates / Printers / Execute print drivers in isolated processes This policy setting determines whether the print spooler will execute print drivers in an isolated or separate process. When print drivers are loaded in an isolated process (or isolated processes), a print driver failure will not cause the print spooler service to fail. If you enable or do not configure this policy setting, the print spooler will execute print drivers in an isolated process by default. If you disable this policy setting, the print spooler will execute print drivers in the print spooler process. Notes: - Other system or driver policy settings may alter the process in which a print driver is executed. - This policy setting applies only to print drivers loaded by the print spooler. Print drivers loaded by applications are not affected. - This policy setting takes effect without restarting the print spooler service.
Related Group Policy SettingsThere is a second configuration option related to printer driver isolation: Computer Configuration / Administrative Templates / Printers / Override print driver execution compatibility setting reported by print driver. Here is the explanation from the group policy editor: This policy setting determines whether the print spooler will override the Driver Isolation compatibility reported by the print driver. This enables executing print drivers in an isolated process, even if the driver does not report compatibility. If you enable this policy setting, the print spooler will ignore the Driver Isolation compatibility flag value reported by the print driver. If you disable or do not configure this policy setting, the print spooler will use the Driver Isolation compatibility flag value reported by the print driver. Notes: - Other system or driver policy settings may alter the process in which a print driver is executed. - This policy setting applies only to print drivers loaded by the print spooler. Print drivers loaded by applications are not affected. - This policy setting takes effect without restarting the print spooler service.
When and How is Isolation Enabled?How a driver is isolated depends on a number of factors. Firstly, the driver manufacturer must have marked it as compatible with isolation in the INF file. Either that, or the group policy setting "Override print driver execution compatibility setting reported by print driver" is enabled by the administrator. If neither is true, a driver is loaded into the spooler process as with previous Windows versions. Note: all inbox drivers shipped with Windows 7 and Server 2008 R2 must support isolation. All drivers to be isolated are, by default, loaded in one single process. They run in "shared mode". Using the print management console (PMC), this can be changed by right-clicking a driver and choosing either:
- None: The driver is not isolated
- Shared: The default. Load the driver into one process together will all other drivers in "shared" isolation mode.
- Isolated: Load the driver into its own process. Recommended for troublemakers.
AnalysisPrinter driver isolation is a very interesting new feature that promises to increase the stability of the printing subsystem, and with it the overall and perceived stability not only of print servers, but also of terminal servers and maybe even single user machines. The price to pay is reasonably low: slightly more overhead because the number of processes needed for printing is higher than with isolation turned off. All in all, it is a good thing that isolation is available and turned on by default, alas for inbox and new drivers marked as compatible only.
- The guys from Microsoft's Ask the performance team blog published a description of printer driver isolation that is very similar to my own - half a year after me ;-)
- Printer Driver Isolation on MSDN
- Printer Installation and Driver Management, slide deck from WinHEC 2008 by Shawn Maloney
- Microsoft filed a patent on printer driver isolation in 2003 which was published only a few weeks ago.
- Many sources, including the explanation texts from the group policy settings cited above, use the term "print driver", which I feel is wrong. A driver does not "drive print" but "drive a printer". So it should be "printer driver" in my opinion.
- If you want to check whether a specific printer driver supports isolation, look for the line "DriverIsolation=2" in the INF file.