removed an ASSERT that occured when system ran out of GDI handles, and added more...
authorRoyce Mitchell III <royce3@ev1.net>
Tue, 7 Dec 2004 19:53:44 +0000 (19:53 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Tue, 7 Dec 2004 19:53:44 +0000 (19:53 +0000)
svn path=/trunk/; revision=11974

reactos/subsys/win32k/objects/cliprgn.c
reactos/subsys/win32k/objects/dc.c

index 81b29f9..d86fa9c 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: cliprgn.c,v 1.42 2004/07/14 20:48:58 navaraf Exp $ */
+/* $Id: cliprgn.c,v 1.43 2004/12/07 19:53:44 royce Exp $ */
 #include <w32k.h>
 
 int FASTCALL
@@ -43,9 +43,13 @@ CLIPPING_UpdateGCRegion(DC* Dc)
       CombinedRegion->rdh.nCount,
       (PRECTL)CombinedRegion->Buffer,
       (PRECTL)&CombinedRegion->rdh.rcBound);
-   ASSERT(Dc->CombinedClip != NULL);
 
    RGNDATA_UnlockRgn(Dc->w.hGCClipRgn);
+   if ( NULL == Dc->CombinedClip )
+   {
+          DPRINT1("IntEngCreateClipRegion() failed\n");
+          return ERROR;
+   }
    return NtGdiOffsetRgn(Dc->w.hGCClipRgn, -Dc->w.DCOrgX, -Dc->w.DCOrgY);
 }
 
@@ -99,7 +103,8 @@ NtGdiSelectVisRgn(HDC hdc, HRGN hrgn)
     }
 
   retval = NtGdiCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
-  CLIPPING_UpdateGCRegion(dc);
+  if ( retval != ERROR )
+    retval = CLIPPING_UpdateGCRegion(dc);
   DC_UnlockDc( hdc );
 
   return retval;
index bccd3d1..79261ac 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.147 2004/11/16 16:27:49 blight Exp $
+/* $Id: dc.c,v 1.148 2004/12/07 19:53:44 royce Exp $
  *
  * DC.C - Device context functions
  *
@@ -1223,7 +1223,11 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
 
          dc->w.hClipRgn = 0;
        }
-       CLIPPING_UpdateGCRegion( dc );
+       {
+               int res;
+               res = CLIPPING_UpdateGCRegion( dc );
+               ASSERT ( res != ERROR );
+       }
        DC_UnlockDc ( hDC );
 #else
        DC_UnlockDc ( hDC );
@@ -2022,8 +2026,13 @@ DC_InitDC(HDC  DCHandle)
   NtGdiSelectObject(DCHandle, NtGdiGetStockObject( BLACK_PEN ));
   //NtGdiSelectObject(DCHandle, hFont);
 
-//  CLIPPING_UpdateGCRegion(DCToInit);
-
+/*
+  {
+    int res;
+    res = CLIPPING_UpdateGCRegion(DCToInit);
+    ASSERT ( res != ERROR );
+  }
+*/
 }
 
 VOID FASTCALL