Help with developing a simple NT 4.0 printer driver

Help with developing a simple NT 4.0 printer driver

Post by Tom Armstron » Wed, 19 Feb 1997 04:00:00



I need to develop a simple NT 4.0 driver that produces a .BMP of the
printed page. I've developed one for NT 3.51 and Windows 95. However, the
new kernel-mode driver model under 4.0 has me quite perplexed. The DDK does
not have any relevant samples and the documention on how to convert the
3.51 driver is poor as well. Any help would be appreciated. I can offer the
3.51 source in trade for a good 4.0 example.

Thanks

Tom
(ActiveX FAQ)
http://www.WidgetWare.com

 
 
 

1. Help with writing a Windows NT 4.0 Printer Graphics Driver

I hope this is appropriate newsgroup for this posting.

I am building a Windows NT 4.0 Printer driver that basically lets GDI
render into a bitmap.  I am not using the Unidriver approach because of
certain limitations, hence I am basing this driver on the Postscript and
FrameBuffer source.  For now, the bitmap is 1 Bit Per Pixel (Monochrome),
and later I would like it to be configurable to 24 Bits Per Pixel.

So far, my driver is working pretty well except for 1 thing.  Somehow, GDI
is not halftoning or dithering into the bitmap.  I am probably not setting
something correctly in GDIINFO or DEVINFO at DrvEnablePDEV().  

I am setting the following:
        devinfo.iDitherFormat = BMF_1BPP;
        // my driver does not create its own brush
        devinfo.cxDither  = 0;
        devinfo.cyDither  = 0;

        devinfo.hPalDefault = EngCreatePalette(PAL_RGB, 0, 0, 0, 0, 0);         // <--Is
this right???

        gdiinfo.ulHTPatternSize = HT_PATSIZE_8x8;               // Tried others, still same
result
        gdiinfo.ulHTOutputFormat = HT_FORMAT_1BPP;              
        gdiinfo.ulHTFlags = HT_FLAG_HAS_BLACK_DYE;      

        gdiinfo.ulNumColors = 2;
        gdiinfo.cBitsPixel = 1;

        gdiinfo.ulDACRed = 8;           // Are these applicable to printers????
        gdiinfo.ulDACGreen = 8;
        gdiinfo.ulDACBlue = 8;

        gdiinfo.ulNumPalReg = 2;

I searched thru' the DDK/MSDN documentation, and I am confounded by this
problem.  I would appreciate any help.

TIA.

--
T. S. Lim

2. Ftp, download files

3. Porting Win95 printer driver & port monitor to NT 4.0

4. External floppy on O2

5. Can NT 4.0 Printer Driver Perform File I/O?

6. Archive for libraries/device handlers?

7. Looking for FULL raster printer driver source for NT 4.0

8. Timing frames

9. Looking for bitmap printer driver source for NT 4.0

10. NT 4.0 printer driver font rotation

11. How to implement own UI of printer driver under NT 4.0

12. DDK printer driver for NT 4.0

13. Simple NT Printer Driver