Hi!
On Tue, Jun 2, 2009 at 6:55 AM, Timo Kreuzer <timo.kreuzer(a)web.de> wrote:
This looks like ultra-hax. Can you explain why this
should be correct?
It would mean DrvSetPixelFormat would be passed a SURFACE rather than a
SURFOBJ.
I updated the wiki about this. We Are doing it wrong if any of the
three pointers point at the BASEOBJECT of the handle structure and not
at "+0x10" SURFOBJ surfobj.....
pdc->dclevel.pSurface;
pdc->pSurfInfo;
ppdev->pSurface;
typedef struct _SURFACE
{ // Win XP
BASEOBJECT BaseObject; // 0x000
SURFOBJ surfobj; // 0x010 <---- above three pointers are set here!
XDCOBJ * pdcoAA; // 0x044
FLONG flags; // 0x048
......
......
Based on DC types one of the pointer is always zero and they toggle
between each other, ppdev->pSurface is always set.
jimtabor(a)svn.reactos.org schrieb:
> Author: jimtabor
> Date: Tue Jun 2 10:50:36 2009
> New Revision: 41250
>
> URL:
http://svn.reactos.org/svn/reactos?rev=41250&view=rev
> Log:
> - Hax-implement NtGdiSetPixelFormat and add a support function UserGethWnd with some
code cleanup.
>
> Modified:
> [...]
> + /*
> + Based on some rules! InfoDC to DC or, based on wiki information!
> + All pointers, it's a "must be!", (CONTAINING_RECORD +10h =
SURFOBJ), the
> + pointer will start at SURFOBJ of the SURFACE structure.
> + */
This is a hack, I'm not sure what to do if the other is zero~ My notes
are very spotty...
+ pso =
(SURFOBJ *)pdc->dclevel.pSurface;
+ if (!pso) pso = pdc->pSurfInfo;
+ if (!pso) pso = ppdev->pSurface;
+ }
+
+ if (ppdev->flFlags & PDEV_META_DEVICE)
+ {
+ UNIMPLEMENTED;
+ goto Exit;
+ }
+
+ if (ppdev->DriverFunctions.SetPixelFormat)
+ {
+ Ret = ppdev->DriverFunctions.SetPixelFormat(
+ pso,
+ ipfd,
+ hWnd);
+ }
Thanks,
James