diff --git a/reactos/include/win32k/dc.h b/reactos/include/win32k/dc.h index a30e32f5f06..4f276dc8cd2 100644 --- a/reactos/include/win32k/dc.h +++ b/reactos/include/win32k/dc.h @@ -79,7 +79,6 @@ typedef struct _DC HDC hSelf; HDC hNext; DHPDEV PDev; - DEVMODEW DMW; HSURF FillPatternSurfaces[HS_DDI_MAX]; PGDIINFO GDIInfo; PDEVINFO DevInfo; diff --git a/reactos/subsys/win32k/ntuser/metric.c b/reactos/subsys/win32k/ntuser/metric.c index 978186a824c..760f6e44f34 100644 --- a/reactos/subsys/win32k/ntuser/metric.c +++ b/reactos/subsys/win32k/ntuser/metric.c @@ -167,8 +167,8 @@ NtUserGetSystemMetrics(ULONG Index) ScreenDC = DC_LockDc(ScreenDCHandle); if (NULL != ScreenDC) { - Width = ScreenDC->DMW.dmPelsWidth; - Height = ScreenDC->DMW.dmPelsHeight; + Width = ScreenDC->GDIInfo->ulHorzRes; + Height = ScreenDC->GDIInfo->ulVertRes; DC_UnlockDc(ScreenDCHandle); } NtGdiDeleteDC(ScreenDCHandle); diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index 3b93e45669c..a58c5fbe62a 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -172,7 +172,6 @@ NtGdiCreateCompatableDC(HDC hDC) NewDC->IsIC = FALSE; NewDC->PDev = OrigDC->PDev; - NewDC->DMW = OrigDC->DMW; memcpy(NewDC->FillPatternSurfaces, OrigDC->FillPatternSurfaces, sizeof OrigDC->FillPatternSurfaces); @@ -779,7 +778,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver, } NewDC->IsIC = CreateAsIC; - NewDC->DMW = PrimarySurface.DMW; NewDC->DevInfo = &PrimarySurface.DevInfo; NewDC->GDIInfo = &PrimarySurface.GDIInfo; memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns, @@ -789,11 +787,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver, NewDC->DriverFunctions = PrimarySurface.DriverFunctions; NewDC->w.hBitmap = PrimarySurface.Handle; - NewDC->DMW.dmSize = sizeof(NewDC->DMW); - NewDC->DMW.dmFields = 0x000fc000; - - NewDC->DMW.dmLogPixels = 96; - NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this here?? + NewDC->w.bitsPerPixel = NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes; DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel); if (! CreateAsIC) @@ -805,9 +799,9 @@ IntGdiCreateDC(PUNICODE_STRING Driver, DC_FreeDC ( hNewDC) ; return NULL; } - ASSERT(NewDC->DMW.dmBitsPerPel == BitsPerFormat(SurfObj->iBitmapFormat)); - ASSERT(NewDC->DMW.dmPelsWidth == SurfObj->sizlBitmap.cx); - ASSERT(NewDC->DMW.dmPelsHeight == SurfObj->sizlBitmap.cy); + ASSERT(NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes == BitsPerFormat(SurfObj->iBitmapFormat)); + ASSERT(NewDC->GDIInfo->ulHorzRes == SurfObj->sizlBitmap.cx); + ASSERT(NewDC->GDIInfo->ulVertRes == SurfObj->sizlBitmap.cy); NewDC->w.hPalette = NewDC->DevInfo->hpalDefault; NewDC->w.ROPmode = R2_COPYPEN;