From 5cdab9e546ec2c0c952bc785f794782fb7325efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Thu, 12 Jul 2012 17:00:39 +0000 Subject: [PATCH] [WIN32K] * When cleaning DC, also "clean" the associated brushes Fixes some asserts hit with Baldur's Gate launcher svn path=/trunk/; revision=56875 --- reactos/win32ss/gdi/ntgdi/dcstate.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reactos/win32ss/gdi/ntgdi/dcstate.c b/reactos/win32ss/gdi/ntgdi/dcstate.c index 0979356a71f..e0c33ae8e7a 100644 --- a/reactos/win32ss/gdi/ntgdi/dcstate.c +++ b/reactos/win32ss/gdi/ntgdi/dcstate.c @@ -73,7 +73,17 @@ IntGdiCleanDC(HDC hDC) 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);