OEMEndPage routine?

How to write OEMEndPage routine? DDK has provided the Bitmap sample… There is only OEMEndDoc routine… It can’t handle Multi Page document… So I want to configure it to print multipage document into a folder containing BMP… So OEMEndPage routine satisfies this requirement… I don’t know how to write it… Help me to refer to some materials which would help me in writing this routine… Give me exact location where i can find if possible… Thank you for all your replies in advance…

On Tue, Mar 11, 2008 at 11:09 AM, wrote:
> So OEMEndPage routine satisfies this requirement… I don’t know how to write it…

If you look inside enabled.cpp, you’ll find that you need to define
IMPL_SENDPAGE.

I think it goes something like this:
- modify ddihook.h (set IMPL_SENDPAGE)
- modify ddihook.cpp (add implementation for OEMSendPage)
- enable.cpp already assumes you’ll name the function
“OEMSendPage()”, so everything is set up IIRC.

HTH.

(BTW: Have you got a port monitor yet? Did you modify the LocalMon
sample, or is there a less verbose sample out there somewhere? I’m
revisiting this question, because one of my test rigs didn’t take
kindly to my current implementation :stuck_out_tongue: Curiously enough, XP and Vista
seem fine, but 2003 is less forgiving)


Rune

xxxxx@gmail.com wrote:

How to write OEMEndPage routine?
[…]
Help me to refer to some materials which would help me in writing
this routine… Give me exact location where i can find if
possible… Thank you for all your replies in advance…

Seems to be not a very urgent bit of work: You asked your first question
about printer drivers on 2008-02-06. Then the same question about
multi-page support for the bitmap driver on 2008-02-16/18, on 2008-03-03
and now (2008-03-11).

Is this a research in “how to find someone (…) who will do the work
for me”, or do you honestly have a problem finding/accessing the links I
gave you?

-H

PS: Any printer driver guru wants to comment?
PPS: Anton, I guess you were right with your assumption.

— re-post of answer from 2008-02-19 13:11 —
xxxxx@gmail.com wrote:

Where could i learn or find code for OEMEndPage DDI hook…

You will have to write this routine yourself. In order to learn:

  • Download the WDK6000RTM or WDK6001.18000.
  • Install the WDK and Help files.
  • READ the bitmap sample files. All of them.
  • UNDERSTAND the bitmap driver sample (using WDK help).
  • READ in the WDK help about GDI/DDI in general.
  • PLAN your driver changes
    (what needs to be different? how can I achieve this?), and
  • IMPLEMENT your changes
  • TEST your driver.

My guess after 5 minutes of looking at WDK help and bitmap\enable.cpp is
that there is a typo in the blog entry I quoted: not “OEMEndPage”, but
OEMSendPage is present in the sample code (hooking - if enabled -
DrvSendPage).

And DrvSendPage is called by the DDI at the end of each page.

Looks like the logical place for code to generate a bitmap file per page.

You will have to write the OEMSendPage routine yourself, so that it
creates a new file (e.g. getting the name via a printer dialog UI or
registry setting), writes the page data (cum bitmap and color header)
into it, closes the file, then resets the bitmap data buffers for the
next page).

(And you will still need some part of the old OEMEndDoc to completely
cleanup everything at the end of the job/document.)

As I am not a printer driver developer myself, everything I wrote above
was glanced from the bitmap sample and from WDK help. Becoming a printer
driver developer, and therefore having more time for it, you should be
able to do much better. Now go on, learn, and write a good driver! -H

— /re-post of answer from 2008-02-19 13:11 —