[WIN32K]
[reactos.git] / subsystems / win32 / win32k / ntuser / metric.c
index 4519ff8..a66aa29 100644 (file)
@@ -24,9 +24,23 @@ FASTCALL
 InitMetrics(VOID)
 {
     INT *piSysMet;
+    PPDEVOBJ ppdev;
+    ULONG Width, Height;
 
-    ULONG Width = pPrimarySurface->gdiinfo.ulHorzRes;
-    ULONG Height = pPrimarySurface->gdiinfo.ulVertRes;
+    /* FIXME: HACK, due to missing PDEV on first init */
+    ppdev = EngpGetPDEV(NULL);
+
+    if (!ppdev)
+    {
+        Width = 640;
+        Height = 480;
+    }
+    else
+    {
+        Width = ppdev->gdiinfo.ulHorzRes;
+        Height = ppdev->gdiinfo.ulVertRes;
+        PDEVOBJ_vRelease(ppdev);
+    }
 
     piSysMet = gpsi->aiSysMet;