Which driver type

One of the first decisions I had to make on this project is which driver type to write, a question which isn’t quite as simple as it might seem. There is a long history behind the Microsoft DDK and driver styles which dates back to early versions of Windows. Each new version of Windows brings new questions about whether the driver is 16, 32 or even 64 bit, is the driver in the kernel or out and finally what framework will I build it on.

After a bit of research the decisions become a bit clearer. The product the driver is going to become part of only runs on Windows NT type systems, ie NT, 2000, XP and 2003 server and we have no intention of supporting the 95/98 series which has been obsolete in business for at least 5 years now.

The first choice is whether to use the Microsoft universal driver model, this is a set of standard driver dll’s which come with Windows and support PCL and PostScript type printers out of the box. As a driver writer all you need to do is write the configuration information on what features your printer has and how to select them in the print file. This is a nice easy model which gives you quick results but has a couple of problems for what I need to do. The PCL output is really quite unlike PDF so there is no way I could bend it to do what I needed, PostScript is a little better but to support it I would need a full blown PostScript interpreter which is what Adobe Distiller has, a project far too large to produce on my own. The alternative to this is to write a full blown printer driver which is what I am doing.

This gives me flexibility to do pretty much what I want in the driver, the only weakness I can see so far is I can’t support encapsulated PostScript which is probably not a huge issue.

The final decision is whether the driver is going to run in user mode or kernel mode. To give you a little background to this printer drivers used to run in user mode in NT 3.51 which is the safer place for them to be, a crash in the driver won’t result in a blue screen. When NT 4 was one of the main features was an increase in performance over 3.51, to achieve this some of the drivers were moved into the kernel and so to support NT 4 I have to write a kernel mode driver. In Windows 2000 I have a choice of kernel and user mode and finally in Longhorn the choice is gone and its user mode all the way.

Debugging a kernel mode driver seems like a pretty painful process and as the long term trend is towards user mode I have decided to abandon NT 4 support and stick with a user mode driver. If I look through my web logs it seems there aren’t many NT4 clients being used and by the time the project is released I don’t think this is going to have a commercial impact.