Hi,
this thread relates to http://www.osronline.com/showThread.cfm?link=160595
Currently I’m working on the (unfortunately) still existing problem with the invisible icons again. I have done a lot of research on the internet but I did not find anything helpful. So I decided to re-implement a simple version of the driver.
In a first version the driver supports the following DrvXxx functions:
- DrvAssertMode
- DrvEnablePDEV, DrvCompletePDEV, DrvDisablePDEV
- DrvEnableSurface, DrvDisableSurface
- DrvEscape
- DrvDisableDriver
- DrvTextOut, DrvBitBlt, DrvCopyBits, DrvStrokePath, DrvAlphaBlend
In DrvEnablePDEV() the DEVINFO-struct is initialized with:
flGraphicsCaps = GCAPS_LAYERED
flGraphicsCaps2 = GCAPS2_ALPHACURSOR
In DrvEnableSurface() two surfaces are created. One engine managed surface EngCreateBitmap, EngAssociateSurface(no hooks)) and one device managed surface (EngCreateDeviceSurface, EngModifySurface(lDelta=0,pvScan0=NULL)). The hooks for the device managed surface are HOOK_BITBLT|HOOK_COPYBITS|HOOK_STROKEPATH|HOOK_TEXTOUT|HOOK_ALPHABLEND. DrvEnableSurface returns the handle to the device managed surface.
If the driver gets called to render something on the device managed surface (DrvTextOut, DrvBitBlt, DrvCopyBits, DrvStrokePath, DrvAlphaBlend) the driver just punts the call back to GDI with the surface(s) modified pointing to the engine managed surface.
I have also created a little user mode test-application which calls ExtEscape() to get a copy of the engine managed surface every 50 ms. The application blits a part of the surface to its client area.
Some more information about the test-machine:
- Intel Celeron M 1Ghz with 2GB of RAM (also tested with Core Duo 2Ghz - same problems)
- Windows XP SP 2
- Intel 855 Embedded Graphics Controller (Dual Head)
As long as the second output of the graphics card is disabled, everything works as expected. The test-application gets a perfect copy of the primary display (including the mouse pointer). After enabling the second output of the graphics card, some desktop icons on the mirror surface disappear (as described in the preceding postings).
The second version of the driver:
More or less by chance I implemented DrvSetPointerShape() and DrvMovePointer() with the GCAPS_PANNING-flag set. DrvSetPointerShape() just returns SPS_ACCEPT_NOEXCLUDE without doing anything.
DrvMovePointer() does nothing, too. In this combination all icons get print on the mirror surface, even if the second output of the graphics card is enabled! As expected in this combination there is no mouse pointer visible on the mirror surface. So, in the next step, I let the driver call EngSetPointerShape() from within DrvSetPointerShape() to ask GDI to simulate the pointer. This ends in the problem with the invisible icons again. ;-(
Have you any ideas or suggestions? Am I missing somthing?
Markus