[WIN32K]
authorJérôme Gardou <jerome.gardou@reactos.org>
Sun, 18 Apr 2010 23:15:02 +0000 (23:15 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Sun, 18 Apr 2010 23:15:02 +0000 (23:15 +0000)
  - Do not create a PDEVOBJ for nothing at startup
  - Create the surface for real in IntCreatePrimarySurface

svn path=/branches/reactos-yarotows/; revision=46930

subsystems/win32/win32k/ntuser/metric.c
subsystems/win32/win32k/objects/cliprgn.c
subsystems/win32/win32k/objects/device.c

index a66aa29..b2bd665 100644 (file)
@@ -24,22 +24,18 @@ FASTCALL
 InitMetrics(VOID)
 {
     INT *piSysMet;
-    PPDEVOBJ ppdev;
     ULONG Width, Height;
 
     /* FIXME: HACK, due to missing PDEV on first init */
-    ppdev = EngpGetPDEV(NULL);
-
-    if (!ppdev)
+    if (!pPrimarySurface)
     {
         Width = 640;
         Height = 480;
     }
     else
     {
-        Width = ppdev->gdiinfo.ulHorzRes;
-        Height = ppdev->gdiinfo.ulVertRes;
-        PDEVOBJ_vRelease(ppdev);
+        Width = pPrimarySurface->gdiinfo.ulHorzRes;
+        Height = pPrimarySurface->gdiinfo.ulVertRes;
     }
 
     piSysMet = gpsi->aiSysMet;
index 09a237e..41a32ee 100644 (file)
@@ -45,7 +45,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
       Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
 
    if (Dc->rosdc.hClipRgn == NULL)
-      NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, ((PROSRGNDATA)Dc->prgnVis)->BaseObject.hHmgr, 0, RGN_COPY);
+      NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, hRgnVis, 0, RGN_COPY);
    else // FYI: Vis == NULL! source of "IntGdiCombineRgn requires hSrc2 != NULL for combine mode 1!"
       NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hClipRgn, hRgnVis, RGN_AND);
    NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
index a35bc71..4d92753 100644 (file)
@@ -41,10 +41,11 @@ IntCreatePrimarySurface()
     /* attach monitor */
     IntAttachMonitor(gppdevPrimary, 0);
 
-DPRINT1("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
+    DPRINT1("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
         pPrimarySurface, pPrimarySurface->pSurface);
 
-    pso = &pPrimarySurface->pSurface->SurfObj;
+    /* Create surface */
+    pso = &PDEVOBJ_pSurface(pPrimarySurface)->SurfObj;
     SurfSize = pso->sizlBitmap;
 
     /* Put the pointer in the center of the screen */