Author: jgardou
Date: Thu Jul 12 17:00:39 2012
New Revision: 56875

URL: http://svn.reactos.org/svn/reactos?rev=56875&view=rev
Log:
[WIN32K]
 * When cleaning DC, also "clean" the associated brushes
Fixes some asserts hit with Baldur's Gate launcher

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/dcstate.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/dcstate.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcstate.c?rev=56875&r1=56874&r2=56875&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] Thu Jul 12 17:00:39 
2012
@@ -73,7 +73,17 @@
     dc = DC_LockDc(hDC);
     if (!dc) return FALSE;
     // Clean the DC
-    if (defaultDCstate) DC_vCopyState(defaultDCstate, dc, FALSE);
+    if (defaultDCstate)
+    {
+        DC_vCopyState(defaultDCstate, dc, FALSE);
+        /* Update the brushes now, because they reference some objects (the DC 
palette)
+         * Which belong to the current process, and this DC might be used for 
another process
+         * after being cleaned up (for GetDC(0) for instance) */
+        DC_vUpdateFillBrush(dc);
+        DC_vUpdateBackgroundBrush(dc);
+        DC_vUpdateLineBrush(dc);
+        DC_vUpdateTextBrush(dc);
+    }
 
     DC_UnlockDc(dc);
 


Reply via email to