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 these functions are tested when printing from different applications,
and they work fine.
But when an application is printing a bitmap using StretchDIBits function,
none of the above driver functions is called.

Is StrechDIBits function writing directly on the driver surface bitmap,
without calling any of Drv...() functions? Is there any way I can hook this
function before it is writing the bitmap on the driver surface?

Thanks
Luminita

Re: Printer drivers and StretchDIBits calls by Vipin

Vipin
Wed Oct 13 01:30:28 CDT 2004

Are you sure the HDC used in StretchDIBits is not a memory device context?


Thanks
Vipin

"Luminita" <magisoft@zappmobile.ro> wrote in message
news:ewk3grOsEHA.1272@TK2MSFTNGP12.phx.gbl...
> 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 these functions are tested when printing from different applications,
> and they work fine.
> But when an application is printing a bitmap using StretchDIBits function,
> none of the above driver functions is called.
>
> Is StrechDIBits function writing directly on the driver surface bitmap,
> without calling any of Drv...() functions? Is there any way I can hook
this
> function before it is writing the bitmap on the driver surface?
>
> Thanks
> Luminita
>
>



Re: Printer drivers and StretchDIBits calls by Luminita

Luminita
Wed Oct 13 02:37:06 CDT 2004

StretchDIBits function is called for instance when printing from MSPaint. I
suppose it uses the printer device context.

Thanks
Luminita

"Vipin" <Vipin@nospam.com> wrote in message
news:eVxVZ3OsEHA.1156@TK2MSFTNGP14.phx.gbl...
> Are you sure the HDC used in StretchDIBits is not a memory device context?
>
>
> Thanks
> Vipin



Re: Printer drivers and StretchDIBits calls by Vipin

Vipin
Wed Oct 13 02:58:59 CDT 2004

You need to make sure what the DC is used. It shoudn't happen that
StretchDIBits(...) you are trying to track down is happening to
intermediate Bitmap to be ultimately transferred using BitBlt(...) to the
device. I have used StretChDIBits(...) and it has succesfully hit the driver
entry points.

Thanks
Vipin

"Luminita" <magisoft@zappmobile.ro> wrote in message
news:ewBo0dPsEHA.636@TK2MSFTNGP09.phx.gbl...
> StretchDIBits function is called for instance when printing from MSPaint.
I
> suppose it uses the printer device context.
>
> Thanks
> Luminita
>
> "Vipin" <Vipin@nospam.com> wrote in message
> news:eVxVZ3OsEHA.1156@TK2MSFTNGP14.phx.gbl...
> > Are you sure the HDC used in StretchDIBits is not a memory device
context?
> >
> >
> > Thanks
> > Vipin
>
>



Re: Printer drivers and StretchDIBits calls by Maxim

Maxim
Wed Oct 13 06:59:18 CDT 2004

> Is StrechDIBits function writing directly on the driver surface bitmap,
> without calling any of Drv...() functions?

Yes, some functions do this.

Use the driver-managed surface, not engine-managed, if you want the total
filtering.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: Printer drivers and StretchDIBits calls by Vipin

Vipin
Wed Oct 13 07:18:31 CDT 2004

If you make a call like this, it won't hit the driver. You can try
supporting DrvCreateDeviceBitmap and see if you get to hit the entry points.
But I don't see the point behind filtering the rendering on intermediate
stuff.

hDCFromCreateDC = CreateDC(...)
HDC memdc = CreateCompatibleDC(hDCFromCreateDC)
HBITMAP hbm = CreatecompatibleBitmap(hDCFromCreateDC , width , height);
SelectObject(memdc , hbm);

StretchDIBits(memdc , .....)


But if you had done:-
StretchDIBits(hDCFromCreateDC , .....) it will always hit the driver whether
engine managed or otherwise.

Thanks
Vipin
"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:ejPEnuRsEHA.2664@TK2MSFTNGP12.phx.gbl...
> > Is StrechDIBits function writing directly on the driver surface bitmap,
> > without calling any of Drv...() functions?
>
> Yes, some functions do this.
>
> Use the driver-managed surface, not engine-managed, if you want the total
> filtering.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>