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.
jimtabor@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), thepointer will start at SURFOBJ of the SURFACE structure.- */
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);- }
Hi!
On Tue, Jun 2, 2009 at 6:55 AM, Timo Kreuzer timo.kreuzer@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@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), thepointer 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
James Tabor wrote:
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 ...... ......
This is from XP:
Hi, After spending some time searching my lab. Back in early 2007, I had a note stating when the handle was in use it pointed to SURFOBJ and not stored at SURFOBJ. Based on the pictures this is true. Sorry for forgeting what I had written down. James
2009/6/3 Timo Kreuzer timo.kreuzer@web.de:
James Tabor wrote:
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 ...... ......