Does it have anything to do with the fact that my printer driver has a
device-managed surface?
Thanks,
ScottR
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Robins, Scott
Sent: Friday, January 28, 2005 1:16 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Printer driver: Calling EngBitBlt from DrvBitBlt ok
to do?
I appreciate the help, so I don’t mind *any* questions.
I’ve tried creating the same bit depth bitmap and have the same problem.
The psoTrg type check is there because I copied the code from elsewhere
in the driver. In the case I am testing, it doesn’t matter (it’s always
true, so removing the check doesn’t change things).
Thanks,
ScottR
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Friday, January 28, 2005 11:24 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Printer driver: Calling EngBitBlt from DrvBitBlt ok
to do?
Don’t have an answer to the questions below, but I have some stupid
questions regarding your code in the original message: 1. You create the
temporary bitmap as a 24bpp bitmap. Are you sure you shouldn’t use the
format of the incoming bitmap as the format? 2. Is psoTrg->iType ==
STYPE_DEVICE there for a reason? It doesn’t seem to be related to any
parameter in the functions below.
I did say “Stupid questions”, so if this is obviously unrelated to the
problem, then I’m sorry. But sometimes the most stupid questions are
useful…
–
Mats
-------- Notice --------
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
xxxxx@lists.osr.com wrote on 01/28/2005 04:05:21 PM:
Thanks.
I actually call EngXXX many other places whenever I decide I can’t do
what it’s asking. But in all those cases, it’s a straight punt, I
simply return the value the call to EngXXX returns. This is the first
time I’ve written code to call EngXXX and then use the results myself,
which is why I’m uncertain (and also probably why it’s not working
:-)). There must be something wrong with the call/parameters.
EngGetLastError() returns 0 and GetLastError() returns 2. The docs
say “an error code is logged” if it returns FALSE. Where is this code
“logged”?
Thanks,
ScottR
Scott Robins
Scott dot Robins at xerox dot com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Friday, January 28, 2005 10:40 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Printer driver: Calling EngBitBlt from DrvBitBlt
ok to do?
I can’t say why you get a return false from EngBitBlt, but I can
certainly say that the intention of EngXXX functions (at least the
ones like
EngBitBlt) is to BE CALLED from your DrvXXX function when your
hardware can’t do the function itself (or you can’t be bothered to
figure out how to do it yourself, or you’re just bringing up a new
device and you don’t know that all functions are working).
So calling it from your DrvBitBlt should be fine. We do that all the
time in our driver (for graphics card, but GDI is the same for
Graphics cards as for Printers, aside from the output device),
whenever there’s a reason we can’t perform the call in our driver.
–
Mats
xxxxx@lists.osr.com wrote on 01/28/2005 03:26:44 PM:
> The printer that my (monolithic, user mode) driver is for doesn’t
> handle certain raster ops well.
>
> So, in an attempt to improve image quality, I am trying to do more
> rendering in my driver.
>
> My first attempt was to take certain operations and attempt to do
> them
> myself, by creating a bitmap and calling EngBitBlt instead of
> passing the request to the printer. Here is a code excerpt from my
> driver’s implementation of
> DrvBitBlt:
>
> if (I decide the printer can’t handle this rop)
> {
> SURFOBJ* psoTmp=NULL;
> HSURF hbmTmp;
> BOOL bSuccess;
>
> hbmTmp = (HSURF)EngCreateBitmap(sizl, (LONG)sizl.cx, BMF_24BPP,
> 0,
> NULL);
>
> if (hbmTmp != NULL) {
> if ((psoTmp = EngLockSurface((HSURF)hbmTmp)) != NULL) {
> if ((psoSrc->iType == STYPE_BITMAP) && (psoTrg->iType ==
> STYPE_DEVICE)) {
> bSuccess = EngBitBlt(psoTmp, psoSrc, psoMask, pco, pxlo,
> prclTrg,pptlSrc,ptlMask, pbo, pptlBrush, rop4);
> if (!bSuccess) {
> ASSERT(0);
> return(FALSE);
> }
> }
> }
> }
> }
>
>
> All the parameters to EngBitBlt with the exception of psoTmp are
> from the call to my DrvBitBlt; sizl is correctly initialized before
> this segment.
>
> My theory is that I’ll now take psoTmp and send it to the printer,
> already rendered. But, the call to EngBitBlt ALWAYS returns false.
>
> Is this just not possible? I do something *very* similar in my
> driver’s CopyBits (calling EngCopyBits) and that works.
>
> Any ideas?
>
> Thanks,
> ScottR
> –
> Scott Robins
> Scott dot Robins at xerox dot com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> ForwardSourceID:NT0000BC52
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@xerox.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT0000BC66
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@xerox.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com