Author: jimtabor Date: Mon Nov 12 07:58:41 2007 New Revision: 30373
URL: http://svn.reactos.org/svn/reactos?rev=30373&view=rev Log: 2nd Sort out gdi device mess.
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/objects/color.c trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/dibobj.c trunk/reactos/subsystems/win32/win32k/objects/print.c
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Mon Nov 12 07:58:41 2007 @@ -495,10 +495,10 @@ ULONG lucExcLock; ULONG Tid;
- DHPDEV PDev; // Handle GDIDEVICE? + DHPDEV PDev; // GDIDEVICE PDev INT DC_Type; INT DC_Flags; - PVOID pPDev; // PGDIDEVICE? + PVOID pPDev; // PGDIDEVICE FLONG flGraphics; FLONG flGraphics2; PDC_ATTR pDc_Attr; @@ -507,11 +507,7 @@ HDC hPrev; // Old tymerz! Cant code? So just Haxzorcise it! // How many pointers to devices do we need? - HSURF FillPatternSurfaces[HS_DDI_MAX]; // In GDIDEVICE PGDIINFO GDIInfo; // In GDIDEVICE - PDEVINFO DevInfo; // In GDIDEVICE - HDEV GDIDevice; // Should be PDev or pPDev? - DRIVER_FUNCTIONS DriverFunctions; // In GDIDEVICE UNICODE_STRING DriverName;
CLIPOBJ *CombinedClip;
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Mon Nov 12 07:58:41 2007 @@ -3,10 +3,6 @@ #define __WIN32K_DC_H
#include "driver.h" - - - -
/* DC flags */ #define DC_MEMORY 0x0001 /* It is a memory DC */ @@ -43,9 +39,9 @@ DHPDEV PDev; DEVMODEW DMW; HSURF FillPatterns[HS_DDI_MAX]; + DEVINFO DevInfo; GDIINFO GDIInfo; - DEVINFO DevInfo; - DRIVER_FUNCTIONS DriverFunctions; + PFILE_OBJECT VideoFileObject; BOOLEAN PreparedDriver; ULONG DisplayNumber; @@ -59,6 +55,7 @@
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
+ DRIVER_FUNCTIONS DriverFunctions; } GDIDEVICE, *PGDIDEVICE;
/* Internal functions */
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntd... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Mon Nov 12 07:58:41 2007 @@ -389,8 +389,7 @@ return 0; case 3: { -/* PGDIDEVICE GDIDevice = (PGDIDEVICE)pDC->PDev; //This one is right,, we have two.*/ - PGDIDEVICE GDIDevice = (PGDIDEVICE)pDC->GDIDevice; //Until now noone noticed. + PGDIDEVICE GDIDevice = (PGDIDEVICE)pDC->pPDev; pEDDgpl = GDIDevice->pEDDgpl; DC_UnlockDc(pDC); return (DWORD)pEDDgpl;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Mon Nov 12 07:58:41 2007 @@ -62,7 +62,7 @@
if (!(dc = DC_LockDc(hDC))) return FALSE; - GDIDevice = (GDIDEVICE *)dc->GDIDevice; + GDIDevice = (GDIDEVICE *)dc->pPDev; DC_UnlockDc(dc);
loc->x = GDIDevice->Pointer.Pos.x; @@ -139,7 +139,7 @@ return Ret; } dcbmp = dc->w.hBitmap; - DevInfo = dc->DevInfo; + DevInfo = (PDEVINFO)&((GDIDEVICE *)dc->pPDev)->DevInfo; DC_UnlockDc(dc);
BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/color.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c Mon Nov 12 07:58:41 2007 @@ -552,14 +552,14 @@ { // Memory managed DC ASSERT(sysGDI->NumColors <= 256); - success = ((GDIDEVICE *)dc->GDIDevice)->DriverFunctions.SetPalette( + success = ((GDIDEVICE *)dc->pPDev)->DriverFunctions.SetPalette( dc->PDev, sysPtr, 0, 0, sysGDI->NumColors);
} else { - if( ((GDIDEVICE *)dc->GDIDevice)->DriverFunctions.SetPalette) + if( ((GDIDEVICE *)dc->pPDev)->DriverFunctions.SetPalette) { ASSERT(palGDI->NumColors <= 256); - success = ((GDIDEVICE *)dc->GDIDevice)->DriverFunctions.SetPalette( + success = ((GDIDEVICE *)dc->pPDev)->DriverFunctions.SetPalette( dc->PDev, palPtr, 0, 0, palGDI->NumColors); } }
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Mon Nov 12 07:58:41 2007 @@ -210,11 +210,7 @@ NewDC->DC_Type = DC_Type;
NewDC->PDev = OrigDC->PDev; - memcpy(NewDC->FillPatternSurfaces, - OrigDC->FillPatternSurfaces, - sizeof OrigDC->FillPatternSurfaces); NewDC->GDIInfo = OrigDC->GDIInfo; - NewDC->DevInfo = OrigDC->DevInfo; NewDC->w.bitsPerPixel = OrigDC->w.bitsPerPixel;
/* DriverName is copied in the AllocDC routine */ @@ -242,7 +238,7 @@ NewDC->w.flags = DC_MEMORY; NewDC->w.hBitmap = hBitmap; NewDC->w.hFirstBitmap = hBitmap; - NewDC->GDIDevice = OrigDC->GDIDevice; + NewDC->pPDev = OrigDC->pPDev;
NewDC->PalIndexed = OrigDC->PalIndexed; NewDC->w.hPalette = OrigDC->w.hPalette; @@ -906,14 +902,11 @@
NewDC->DC_Type = DC_TYPE_DIRECT; NewDC->IsIC = CreateAsIC; - NewDC->DevInfo = &PrimarySurface.DevInfo; + NewDC->GDIInfo = &PrimarySurface.GDIInfo; - memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns, - sizeof(NewDC->FillPatternSurfaces)); NewDC->PDev = PrimarySurface.PDev; if(pUMdhpdev) pUMdhpdev = NewDC->PDev; - NewDC->GDIDevice = (HDEV)&PrimarySurface; - NewDC->DriverFunctions = PrimarySurface.DriverFunctions; + NewDC->pPDev = (PVOID)&PrimarySurface; NewDC->w.hBitmap = PrimarySurface.Handle;
NewDC->w.bitsPerPixel = NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes; @@ -922,7 +915,7 @@ if (! CreateAsIC) { NewDC->PalIndexed = NtGdiGetStockObject(DEFAULT_PALETTE); - NewDC->w.hPalette = NewDC->DevInfo->hpalDefault; + NewDC->w.hPalette = PrimarySurface.DevInfo.hpalDefault; NewDC->Dc_Attr.jROP2 = R2_COPYPEN;
DC_UnlockDc( NewDC ); @@ -2119,7 +2112,7 @@ else { dc->w.bitsPerPixel = BitsPerFormat(pb->SurfObj.iBitmapFormat); - dc->w.hPalette = dc->DevInfo->hpalDefault; + dc->w.hPalette = ((DEVINFO)((GDIDEVICE *)dc->pPDev)->DevInfo).hpalDefault; }
/* Reselect brush and pen to regenerate the XLATEOBJs. */ @@ -2735,7 +2728,7 @@ DesktopHDC = (HDC)UserGetWindowDC(DesktopObject); pDC = DC_LockDc(DesktopHDC);
- *DisplayNumber = ((GDIDEVICE *)pDC->GDIDevice)->DisplayNumber; + *DisplayNumber = ((GDIDEVICE *)pDC->pPDev)->DisplayNumber;
DC_UnlockDc(pDC); UserReleaseDC(DesktopObject, DesktopHDC, FALSE); @@ -3259,7 +3252,7 @@ { return FALSE; } - swprintf (szBuffer, L"\\.\DISPLAY%lu", ((GDIDEVICE *)DC->GDIDevice)->DisplayNumber); + swprintf (szBuffer, L"\\.\DISPLAY%lu", ((GDIDEVICE *)DC->pPDev)->DisplayNumber); DC_UnlockDc(DC);
RtlInitUnicodeString(&InDeviceName, szBuffer);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Mon Nov 12 07:58:41 2007 @@ -209,7 +209,7 @@ }
// Destination palette obtained from the hDC - hDCPalette = PALETTE_LockPalette(DC->DevInfo->hpalDefault); + hDCPalette = PALETTE_LockPalette(((DEVINFO)((GDIDEVICE *)DC->pPDev)->DevInfo).hpalDefault); if (NULL == hDCPalette) { EngUnlockSurface(SourceSurf); @@ -219,7 +219,7 @@ return 0; } DDB_Palette_Type = hDCPalette->Mode; - DDB_Palette = DC->DevInfo->hpalDefault; + DDB_Palette = ((DEVINFO)((GDIDEVICE *)DC->pPDev)->DevInfo).hpalDefault; PALETTE_UnlockPalette(hDCPalette);
// Source palette obtained from the BITMAPINFO
Modified: trunk/reactos/subsystems/win32/win32k/objects/print.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/print.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/print.c Mon Nov 12 07:58:41 2007 @@ -119,7 +119,7 @@
/* FIXME - Handle BitmapObj == NULL !!!!!! */
- if ( NULL == dc->DriverFunctions.Escape ) + if ( NULL == ((GDIDEVICE *)dc->pPDev)->DriverFunctions.Escape ) { Result = IntEngExtEscape( &BitmapObj->SurfObj, @@ -131,7 +131,7 @@ } else { - Result = dc->DriverFunctions.Escape( + Result = ((GDIDEVICE *)dc->pPDev)->DriverFunctions.Escape( &BitmapObj->SurfObj, Escape, InSize,