Device managed to engine managed

Discussion in 'Windows Vista Drivers' started by neoadam, Feb 16, 2006.

  1. neoadam

    neoadam Guest

    Hi all,
    I have a monolithic printer driver and I wish that the gdi calls my hooked
    functions but should my driver be unable to render the surface given I wish
    to be able to punt to the gdi to render it for me.

    now in my DrvEnablePDEV I have the folloing code

    //allocating a monochrome page size bitmap
    pPDev->pbBitmap = (LPBYTE)LocalAlloc(LPTR, pPDev->HorzRes * pPDev->VertRes);

    // Creating and associating the surface
    (HBITMAP)pPDev->hsurf =
    (HBITMAP)EngCreateBitmap(SurfSize,,BMF_1BPP, BMF_USERMEM |
    bRet = EngAssociateSurface((HSURF)pPDev->hsurf, (HDEV)pPDev->hpdev,

    //returning the surface created

    Now assuming that I dont now how to render a TextOut call I wish to punt it
    to the GDI to create the Bitmap for me:

    // Punt call to GDI if no special rendering can be done
    pso->iType = STYPE_BITMAP;
    if (EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore,
    pboOpaque, pptlBrushOrg, mix ) == DDI_ERROR)
    return DDI_ERROR;

    What happens is that my bitmap buffer is not getting filled, it remains full
    of 0s.

    I have read that there is a way to actually do the operation above but
    unfortunatley I still cannot find out how to code such an operation.

    Could anyone please hint me on whats missing in my code or what should I do.

    Thanks alot
    neoadam, Feb 16, 2006
    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.