[win32k]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 27 Apr 2011 12:33:16 +0000 (12:33 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 27 Apr 2011 12:33:16 +0000 (12:33 +0000)
-Fix a case when a window is created and we don't have a monitor created yet. (This can happen when we may attempt to use gui on demand)

svn path=/trunk/; revision=51464

reactos/subsystems/win32/win32k/ntuser/window.c

index 1b4c0b3..8bb6b56 100644 (file)
@@ -1555,7 +1555,15 @@ IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWND ParentWindow, DWORD* dwShowMode)
       PRTL_USER_PROCESS_PARAMETERS ProcessParams;
 
       pMonitor = IntGetPrimaryMonitor();
-      ASSERT(pMonitor);
+
+      /* Check if we don't have a monitor attached yet */
+      if(pMonitor == NULL)
+      {
+          Cs->x = Cs->y = 0;
+          Cs->cx = 800;
+          Cs->cy = 600;
+          return;
+      }
 
       ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;