// JP opened flex table

Click to See Complete Forum and Search --> : Virtual printer driver problem with MSPaint


Luminita
October 12th, 2004, 03:19 AM
Hello

I am writing a virtual printer driver for Win XP/2000. The driver is using an engine-managed surface and is hooking all next DDI functions:
- DrvBitBlt
- DrvStretchBlt
- DrvTransparentBlt
- DrvCopyBits
- DrvAlphaBlend
- DrvStretchBltROP
- DrvPlgBlt

All this functions are tested when printing from different applications, and they work fine.

But there is a problem when printing from MSPaint. None of these function is called between DrvStartPage and DrvSendPage.

Does anyone know what painting functions is MSPaint using? Because I think I hooked all DDI functions that are handling image painting and noe of them is called.

Thanks

darshit.shah
May 2nd, 2006, 06:09 AM
Hey ...

We are going to create a Virtual Printer Driver which will create a PDF file.
We have already created a dll file which contains methods to create & modify PDF files.

Now from where to start creating a virtual printer driver that we don't know

So, Could u help me out???

Thanks in advance.

Skeeterbreath
May 16th, 2006, 04:27 PM
Congratulations for getting as far as you have. The fact that you have succeeded in getting a graphics DLL engine up and running, that actually captures function calls coming from the GDI is impressive. You would not beleive how many people fail at getting as far as you have.

Try a brute force approch. I am sure that by this point you know that some Drv_ functions are mandantory, some are recommended, and some are completely optional.

The list is not terribly long. Just place empty hooks for all possible Drv_ functions in your DLL, and make sure to load all the function pointers in the function pointer table so the GDI knows you are hooking all of them.

let the hooks print out messages, letting you know which one is being hit and under what circumstances.

Then sit back, run MSPAint, print from it to your driver, and see which of your Drv_ functions print out messages. Then you should know which ones you need to implement.

Skeet

//JP added flex table