GDI never called any DDI functions for bitmaps in MS WORD 2000

Discussion in 'Windows Vista Drivers' started by DriverStarter, Aug 31, 2005.

  1. I have a problem with Ms word 2000. when GDI renering a bitmap in word 2000,
    it never calles any DDI functions evene if I hook all the functions
    vailable. I have a engine-managed bitmap. all other versions of MS WORD
    seems calling DDI functions.


    Question is, what flag I should set to make GDI call DDI function?


    Thanks
     
    DriverStarter, Aug 31, 2005
    #1
    1. Advertisements

  2. DriverStarter

    Scott Robins Guest

    I'm going to assume because of your other posts that this is a pritner
    driver.

    I've never written a printer driver that used an engine-managed surface
    (which is what I assume you mean by 'engine-managed bitmap'). But I was
    under the impression that GDI did all the work on an engine-managed
    surface. So I guess that I am surprised that your driver gets called at
    all.
     
    Scott Robins, Aug 31, 2005
    #2
    1. Advertisements

  3. --------------------
    From: "DriverStarter" <>
    Subject: GDI never called any DDI functions for bitmaps in MS WORD 2000
    Date: Wed, 31 Aug 2005 11:05:47 -0400
    Lines: 12
    X-Priority: 3
    X-MSMail-Priority: Normal


    I have a problem with Ms word 2000. when GDI renering a bitmap in word
    2000,
    it never calles any DDI functions evene if I hook all the functions
    vailable. I have a engine-managed bitmap. all other versions of MS WORD
    seems calling DDI functions.


    Question is, what flag I should set to make GDI call DDI function?


    Thanks


    Look at EMF spool file generated with the two versions of word and see the
    difference.
    There is an emf.exe available in the feng yuan's site which can be used to
    open the emf spool file and decode it.
    http://www.fengyuan.com/download.html

    Hope this helps.

    Thank you,
    Bobby Mattappally
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Bobby Mattappally [MS], Sep 1, 2005
    #3
  4. Question is, what flag I should set to make GDI call DDI function?

    IIRC there were some HOOK_xxx flags.
     
    Maxim S. Shatskih, Sep 1, 2005
    #4
  5. Yes, what is happening in my current driver is, I provide all DDI functions
    in my monolithic driver, and then punt to GDI to do all the rendering. This
    is based on the assumption that, For every object in an application, GDI
    will call at least one of the DDI function., even if my surface is a
    engine-managed DIB surface.


    I checked one of posting in this room, in title "RE: Intercepting GDI
    calls at the DDI level"(7/28/05), he stated that "GDI will not always call
    DDI functions if the surface is transparent to it (i.e. in DIB format)".
    Please comment on this statement, cause if what he said is true, then my
    assumption is wrong.

    by the way, I downloaded the EMF spool file from FengYuan's site, open MS
    word 2000, insert the emf as a picture, then print, debugger does stop on
    DrvBitblt and DrvStrokePath, and this is what my driver supposed to happen,
    this is good. what doe not work is, if open MS word2000, insert a bitmap
    file (.bmp, not .emf), doing print, debug never stop on any DDI functions
    (neither DrvStretch Blt, DrvBitBlt, DrvStretchBltRop, etc.). other objects
    (vector and text) work fine under WORD2000.


    Any one knows something special for MS word 2000 deal with bitmap?


    Thanks a million
     
    DriverStarter, Sep 1, 2005
    #5
  6. DriverStarter

    Vipin Guest

    I won't be surprised to see a bitmap not having to be punted back. you can
    set things in halftone mode and
    I guess, it should hit instead of doing internal GDI-GDI call.

    Thanks
    Vipin
     
    Vipin, Sep 1, 2005
    #6
  7. thanks for comments, Vipin.


    I announced my devie to be a 24-bit-colored device, which GDI will not do
    halftoning.


    correct me if I am wrong.
     
    DriverStarter, Sep 2, 2005
    #7
  8. --------------------
    From: "DriverStarter" <>
    References: <>
    <$>
    <>
    <Ox5Kb#>
    <#aBwB#>
    Subject: Re: GDI never called any DDI functions for bitmaps in MS WORD 2000
    Date: Fri, 2 Sep 2005 11:09:34 -0400


    I announced my devie to be a 24-bit-colored device, which GDI will not do
    halftoning.


    correct me if I am wrong.




    The only way to guarantee that your driver functions will get called is by
    making the surface device managed. For engine managed surfaces gdi can do
    its own optimizations on how a GDI call is rendered into the surface.

    Now if you want to see what exaclty is different between word 2000 and
    other apps, generate the EMF spool file and decode it. I think my earlier
    message was not clear enough on how to do it. Here are the steps:

    1) Go to printer propeties: Advanced tab and make sure "Enable Advanced
    Printing Featues" is enabled. Thsi enables EMF spooling.
    2) Right click on the printer and select suspend
    3) Print to the printer (do not select Print to File, it will force RAW
    spooling)
    4) You will see the job in the queue
    5) In the spool directory you will an spl file created cor to the job.
    6) using the emf.exe downloaded from the site I mentioned , open the .spl
    with with it.
    7) Select the decode into C/C++ option to generate the C++ file cor to it.
    8) Do the above steps 3-7 with the other version word or app that is
    "working".
    9) Do a diff on the two generated C++ files to see the difference in the
    GDI calls generated by word 2000 vs the other app(s).





    Hope this helps.

    Thank you,
    Bobby Mattappally
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Bobby Mattappally [MS], Sep 2, 2005
    #8
  9. Thanks for so much info, Bobby.

    the diagnostic method you introduced definitely a good way to trace the
    relationship between GDI 's API call and the DDI functions. It also is a
    valuable tool to solve my other problems. Appreciate the good advice.


    To my surprise, I tried Vipin's suggestion, driver WORKs on Word2000. I
    guess by setting halftone capability flag, GDI will not do optimization by
    itself, instead it pass to driver .


    Regards,



    Xiao
     
    DriverStarter, Sep 6, 2005
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.