I think I’ve answered my own question.
Can someone let me know if I have this right.
Inside DrvSurfaceEnable.
I need to use EngCreateBitmap and EngAssoicateSurface to create my own surface, which is just a link to a bitmap memory location.
I need also to use EngCreateDeviceSurface so that I can hook all calls made to the graphics device. (which is also made to my mirror driver.)
If I change the Desktop, (say for example, the user desktop (1440x900x32) to the service desktop (1024x768x32)) Which functions are called to detect this change?
When the hooked EngCreateDeviceSurface called DrvBitBlt, I then run EngBitBlt on the Source OBJSURF, to my own OBJSURF surface. (EngBitBlt(&MySurface, psoSrc, …) so I don’t have to forfill the drawing myself.
The information for the bitmap is stored in MySurface and I use this to generate the screenshot of what is currently on screen. This would be simple but even with the suggested changes I seem to only pick up some images and not everything that appears in a screenshot.If I picked up everything from psoSrc->pvBits I would understand and be able to move on from here.
This does seem to be a lot harder than I thought it would be but I don’t usually give up so please excuse me here.
What are the requirements for PPDEV ppdev = (PPDEV) dhpdev; ? because it seems like this is a custom struct type where I could add / remove types.
Tim, I’m understanding and getting my head around a lot, thank you very much for everything so far.
The only error I am recieving is sometimes when I deattach the mirror driver, the screen goes blank. (sometimes and not always constant for the same compiled code.) It is only the graphics driver, any music, mouse / keyboard operations are fine, windows is still running. I am wondering also if there is a way to detect this and have the graphics driver restart itself.