I have a monolithic usermode printer driver (see my numerous previous
question for details :) under development. It's adapted from an earlier
kernel-mode printer driver. I'm trying to work out the final kinks, and I've
come across some rather odd behavior.

I've found that some applications have trouble printing particular shapes
(diagonal lines and ellipsesfor example) on any page except the first. In the
kernel-mode driver, these work fine, and in the debug output I can see calls
to DrvBitBlt for each of these shapes that is drawn on the printed image.

In user-mode, I don't see these calls. In fact, I don't see any of my driver
code being called. Somehow these shapes make it onto the first page I print,
but never the second.

I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.

How would the application get data onto the driver's surfaces?

--
Matt Kane
mkane@zebra.camel.com minus cigarettes

Re: hooked functions in usermode printer driver by Vipin

Vipin
Wed Oct 13 00:35:22 CDT 2004

That should be a problem with your driver and how you are managing the
surfaces. Get an HP driver from their website and print, there are User Mode
Monolithic drivers available on their website.They will all print properly
on all the pages. BTW what surface are you using device managed ot engine
managed??


"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:A9F806B2-6EE7-4DB8-8CAC-CABF21C55CC5@microsoft.com...
> I have a monolithic usermode printer driver (see my numerous previous
> question for details :) under development. It's adapted from an earlier
> kernel-mode printer driver. I'm trying to work out the final kinks, and
I've
> come across some rather odd behavior.
>
> I've found that some applications have trouble printing particular shapes
> (diagonal lines and ellipsesfor example) on any page except the first. In
the
> kernel-mode driver, these work fine, and in the debug output I can see
calls
> to DrvBitBlt for each of these shapes that is drawn on the printed image.
>
> In user-mode, I don't see these calls. In fact, I don't see any of my
driver
> code being called. Somehow these shapes make it onto the first page I
print,
> but never the second.
>
> I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
> DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.
>
> How would the application get data onto the driver's surfaces?
>
> --
> Matt Kane
> mkane@zebra.camel.com minus cigarettes



Re: hooked functions in usermode printer driver by MattKane

MattKane
Wed Oct 13 08:41:02 CDT 2004

Engine-managed. How would an HP driver help me? Do they have source code
available? There don't seem to be any examples of this in the DDK samples.

"Vipin" wrote:

> That should be a problem with your driver and how you are managing the
> surfaces. Get an HP driver from their website and print, there are User Mode
> Monolithic drivers available on their website.They will all print properly
> on all the pages. BTW what surface are you using device managed ot engine
> managed??
>
>
> "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> news:A9F806B2-6EE7-4DB8-8CAC-CABF21C55CC5@microsoft.com...
> > I have a monolithic usermode printer driver (see my numerous previous
> > question for details :) under development. It's adapted from an earlier
> > kernel-mode printer driver. I'm trying to work out the final kinks, and
> I've
> > come across some rather odd behavior.
> >
> > I've found that some applications have trouble printing particular shapes
> > (diagonal lines and ellipsesfor example) on any page except the first. In
> the
> > kernel-mode driver, these work fine, and in the debug output I can see
> calls
> > to DrvBitBlt for each of these shapes that is drawn on the printed image.
> >
> > In user-mode, I don't see these calls. In fact, I don't see any of my
> driver
> > code being called. Somehow these shapes make it onto the first page I
> print,
> > but never the second.
> >
> > I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
> > DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.
> >
> > How would the application get data onto the driver's surfaces?
> >
> > --
> > Matt Kane
> > mkane@zebra.camel.com minus cigarettes
>
>
>

Re: hooked functions in usermode printer driver by Vipin

Vipin
Wed Oct 13 09:15:00 CDT 2004

ok,ok, I now I understand in 2000/XP you will have to use banding method
because EngCreateBitmap fails for large sizes in usermode.

In kernel mode the call suceeds for large sizes also.

I had seen this behaviour before.

In fact the engine surface creation has failed I feel over there. check the
return code of EngCreateBitmap(...)




"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:3078C779-314C-4F7B-B988-C03F93DDE617@microsoft.com...
> Engine-managed. How would an HP driver help me? Do they have source code
> available? There don't seem to be any examples of this in the DDK samples.
>
> "Vipin" wrote:
>
> > That should be a problem with your driver and how you are managing the
> > surfaces. Get an HP driver from their website and print, there are User
Mode
> > Monolithic drivers available on their website.They will all print
properly
> > on all the pages. BTW what surface are you using device managed ot
engine
> > managed??
> >
> >
> > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > news:A9F806B2-6EE7-4DB8-8CAC-CABF21C55CC5@microsoft.com...
> > > I have a monolithic usermode printer driver (see my numerous previous
> > > question for details :) under development. It's adapted from an
earlier
> > > kernel-mode printer driver. I'm trying to work out the final kinks,
and
> > I've
> > > come across some rather odd behavior.
> > >
> > > I've found that some applications have trouble printing particular
shapes
> > > (diagonal lines and ellipsesfor example) on any page except the first.
In
> > the
> > > kernel-mode driver, these work fine, and in the debug output I can see
> > calls
> > > to DrvBitBlt for each of these shapes that is drawn on the printed
image.
> > >
> > > In user-mode, I don't see these calls. In fact, I don't see any of my
> > driver
> > > code being called. Somehow these shapes make it onto the first page I
> > print,
> > > but never the second.
> > >
> > > I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
> > > DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.
> > >
> > > How would the application get data onto the driver's surfaces?
> > >
> > > --
> > > Matt Kane
> > > mkane@zebra.camel.com minus cigarettes
> >
> >
> >



Re: hooked functions in usermode printer driver by MattKane

MattKane
Wed Oct 13 09:19:07 CDT 2004

I doubt that's it, as it's only certain things that aren't drawn on the
surface. For instance, if I draw a square and a circle in one particular
application, only the square will be printed.

"Vipin" wrote:

> ok,ok, I now I understand in 2000/XP you will have to use banding method
> because EngCreateBitmap fails for large sizes in usermode.
>
> In kernel mode the call suceeds for large sizes also.
>
> I had seen this behaviour before.
>
> In fact the engine surface creation has failed I feel over there. check the
> return code of EngCreateBitmap(...)
>
>
>
>
> "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> news:3078C779-314C-4F7B-B988-C03F93DDE617@microsoft.com...
> > Engine-managed. How would an HP driver help me? Do they have source code
> > available? There don't seem to be any examples of this in the DDK samples.
> >
> > "Vipin" wrote:
> >
> > > That should be a problem with your driver and how you are managing the
> > > surfaces. Get an HP driver from their website and print, there are User
> Mode
> > > Monolithic drivers available on their website.They will all print
> properly
> > > on all the pages. BTW what surface are you using device managed ot
> engine
> > > managed??
> > >
> > >
> > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > news:A9F806B2-6EE7-4DB8-8CAC-CABF21C55CC5@microsoft.com...
> > > > I have a monolithic usermode printer driver (see my numerous previous
> > > > question for details :) under development. It's adapted from an
> earlier
> > > > kernel-mode printer driver. I'm trying to work out the final kinks,
> and
> > > I've
> > > > come across some rather odd behavior.
> > > >
> > > > I've found that some applications have trouble printing particular
> shapes
> > > > (diagonal lines and ellipsesfor example) on any page except the first.
> In
> > > the
> > > > kernel-mode driver, these work fine, and in the debug output I can see
> > > calls
> > > > to DrvBitBlt for each of these shapes that is drawn on the printed
> image.
> > > >
> > > > In user-mode, I don't see these calls. In fact, I don't see any of my
> > > driver
> > > > code being called. Somehow these shapes make it onto the first page I
> > > print,
> > > > but never the second.
> > > >
> > > > I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
> > > > DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.
> > > >
> > > > How would the application get data onto the driver's surfaces?
> > > >
> > > > --
> > > > Matt Kane
> > > > mkane@zebra.camel.com minus cigarettes
> > >
> > >
> > >
>
>
>

Re: hooked functions in usermode printer driver by Vipin

Vipin
Wed Oct 13 09:52:50 CDT 2004

Are your hooks specified properly in DrvEnableSurface(...)?

"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:452D8CC0-D896-45B5-9642-52CEB75A97CB@microsoft.com...
> I doubt that's it, as it's only certain things that aren't drawn on the
> surface. For instance, if I draw a square and a circle in one particular
> application, only the square will be printed.
>
> "Vipin" wrote:
>
> > ok,ok, I now I understand in 2000/XP you will have to use banding
method
> > because EngCreateBitmap fails for large sizes in usermode.
> >
> > In kernel mode the call suceeds for large sizes also.
> >
> > I had seen this behaviour before.
> >
> > In fact the engine surface creation has failed I feel over there. check
the
> > return code of EngCreateBitmap(...)
> >
> >
> >
> >
> > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > news:3078C779-314C-4F7B-B988-C03F93DDE617@microsoft.com...
> > > Engine-managed. How would an HP driver help me? Do they have source
code
> > > available? There don't seem to be any examples of this in the DDK
samples.
> > >
> > > "Vipin" wrote:
> > >
> > > > That should be a problem with your driver and how you are managing
the
> > > > surfaces. Get an HP driver from their website and print, there are
User
> > Mode
> > > > Monolithic drivers available on their website.They will all print
> > properly
> > > > on all the pages. BTW what surface are you using device managed ot
> > engine
> > > > managed??
> > > >
> > > >
> > > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > > news:A9F806B2-6EE7-4DB8-8CAC-CABF21C55CC5@microsoft.com...
> > > > > I have a monolithic usermode printer driver (see my numerous
previous
> > > > > question for details :) under development. It's adapted from an
> > earlier
> > > > > kernel-mode printer driver. I'm trying to work out the final
kinks,
> > and
> > > > I've
> > > > > come across some rather odd behavior.
> > > > >
> > > > > I've found that some applications have trouble printing particular
> > shapes
> > > > > (diagonal lines and ellipsesfor example) on any page except the
first.
> > In
> > > > the
> > > > > kernel-mode driver, these work fine, and in the debug output I can
see
> > > > calls
> > > > > to DrvBitBlt for each of these shapes that is drawn on the printed
> > image.
> > > > >
> > > > > In user-mode, I don't see these calls. In fact, I don't see any of
my
> > > > driver
> > > > > code being called. Somehow these shapes make it onto the first
page I
> > > > print,
> > > > > but never the second.
> > > > >
> > > > > I am hooking DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvTextOut,
> > > > > DrvFillPath, DrvStrokePath, DrvStrokeAndFillPath, and DrvLineTo.
> > > > >
> > > > > How would the application get data onto the driver's surfaces?
> > > > >
> > > > > --
> > > > > Matt Kane
> > > > > mkane@zebra.camel.com minus cigarettes
> > > >
> > > >
> > > >
> >
> >
> >



Re: hooked functions in usermode printer driver by MattKane

MattKane
Wed Oct 13 10:01:03 CDT 2004

As far as I can tell, yes. They are all present in the DRVENABLEDATA
structure as well.

I wonder if it has something to do with the way I call
EngAssociateSurface(). Should that be called once for each surface I have
created?

"Vipin" wrote:

> Are your hooks specified properly in DrvEnableSurface(...)?


Re: hooked functions in usermode printer driver by Vipin

Vipin
Wed Oct 13 23:58:41 CDT 2004

What about EngAssocaitSurface's last parameter?

"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> As far as I can tell, yes. They are all present in the DRVENABLEDATA
> structure as well.
>
> I wonder if it has something to do with the way I call
> EngAssociateSurface(). Should that be called once for each surface I have
> created?
>
> "Vipin" wrote:
>
> > Are your hooks specified properly in DrvEnableSurface(...)?
>



Re: hooked functions in usermode printer driver by MattKane

MattKane
Thu Oct 14 08:17:02 CDT 2004

As far as I can tell it is correct.

"Vipin" wrote:

> What about EngAssocaitSurface's last parameter?
>
> "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> > As far as I can tell, yes. They are all present in the DRVENABLEDATA
> > structure as well.
> >
> > I wonder if it has something to do with the way I call
> > EngAssociateSurface(). Should that be called once for each surface I have
> > created?
> >
> > "Vipin" wrote:
> >
> > > Are your hooks specified properly in DrvEnableSurface(...)?
> >
>
>
>

Re: hooked functions in usermode printer driver by Vipin

Vipin
Thu Oct 14 12:05:57 CDT 2004

I did notice you haven't got DrvStretchBltROP exposed.
Expose it and see if it makes any difference.

"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:D68CF53C-B756-4175-8C3A-A87F6083F0D6@microsoft.com...
> As far as I can tell it is correct.
>
> "Vipin" wrote:
>
> > What about EngAssocaitSurface's last parameter?
> >
> > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> > > As far as I can tell, yes. They are all present in the DRVENABLEDATA
> > > structure as well.
> > >
> > > I wonder if it has something to do with the way I call
> > > EngAssociateSurface(). Should that be called once for each surface I
have
> > > created?
> > >
> > > "Vipin" wrote:
> > >
> > > > Are your hooks specified properly in DrvEnableSurface(...)?
> > >
> >
> >
> >



Re: hooked functions in usermode printer driver by MattKane

MattKane
Thu Oct 14 15:53:03 CDT 2004

Nope, no difference.

"Vipin" wrote:

> I did notice you haven't got DrvStretchBltROP exposed.
> Expose it and see if it makes any difference.
>
> "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> news:D68CF53C-B756-4175-8C3A-A87F6083F0D6@microsoft.com...
> > As far as I can tell it is correct.
> >
> > "Vipin" wrote:
> >
> > > What about EngAssocaitSurface's last parameter?
> > >
> > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> > > > As far as I can tell, yes. They are all present in the DRVENABLEDATA
> > > > structure as well.
> > > >
> > > > I wonder if it has something to do with the way I call
> > > > EngAssociateSurface(). Should that be called once for each surface I
> have
> > > > created?
> > > >
> > > > "Vipin" wrote:
> > > >
> > > > > Are your hooks specified properly in DrvEnableSurface(...)?
> > > >
> > >
> > >
> > >
>
>
>

Re: hooked functions in usermode printer driver by vipin

vipin
Sat Oct 16 12:48:12 CDT 2004

I need your driver,binaries would do.
"Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
news:761799CC-F259-4736-9DAC-A9ECAC02508D@microsoft.com...
> Nope, no difference.
>
> "Vipin" wrote:
>
> > I did notice you haven't got DrvStretchBltROP exposed.
> > Expose it and see if it makes any difference.
> >
> > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > news:D68CF53C-B756-4175-8C3A-A87F6083F0D6@microsoft.com...
> > > As far as I can tell it is correct.
> > >
> > > "Vipin" wrote:
> > >
> > > > What about EngAssocaitSurface's last parameter?
> > > >
> > > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > > news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> > > > > As far as I can tell, yes. They are all present in the
DRVENABLEDATA
> > > > > structure as well.
> > > > >
> > > > > I wonder if it has something to do with the way I call
> > > > > EngAssociateSurface(). Should that be called once for each surface
I
> > have
> > > > > created?
> > > > >
> > > > > "Vipin" wrote:
> > > > >
> > > > > > Are your hooks specified properly in DrvEnableSurface(...)?
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >



Re: hooked functions in usermode printer driver by MattKane

MattKane
Mon Oct 18 08:37:02 CDT 2004

In that case I will need your email address! Mine is mkane@orange.zebra.com
(minus fruit)


"vipin" wrote:

> I need your driver,binaries would do.
> "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> news:761799CC-F259-4736-9DAC-A9ECAC02508D@microsoft.com...
> > Nope, no difference.
> >
> > "Vipin" wrote:
> >
> > > I did notice you haven't got DrvStretchBltROP exposed.
> > > Expose it and see if it makes any difference.
> > >
> > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > news:D68CF53C-B756-4175-8C3A-A87F6083F0D6@microsoft.com...
> > > > As far as I can tell it is correct.
> > > >
> > > > "Vipin" wrote:
> > > >
> > > > > What about EngAssocaitSurface's last parameter?
> > > > >
> > > > > "Matt Kane" <MattKane@discussions.microsoft.com> wrote in message
> > > > > news:EAC0C302-4474-45B8-8C12-43E0F0DB8A9B@microsoft.com...
> > > > > > As far as I can tell, yes. They are all present in the
> DRVENABLEDATA
> > > > > > structure as well.
> > > > > >
> > > > > > I wonder if it has something to do with the way I call
> > > > > > EngAssociateSurface(). Should that be called once for each surface
> I
> > > have
> > > > > > created?
> > > > > >
> > > > > > "Vipin" wrote:
> > > > > >
> > > > > > > Are your hooks specified properly in DrvEnableSurface(...)?
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>