From 792f0b68600bc7b8d10d254f9b740db32bbef226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 23 Oct 2003 15:34:44 +0000 Subject: [PATCH] Mark system color brushes as global so they won't be deleted when the process which created them terminates svn path=/trunk/; revision=6414 --- reactos/subsys/win32k/objects/color.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/reactos/subsys/win32k/objects/color.c b/reactos/subsys/win32k/objects/color.c index f1e72ca10c6..1ed5452c72a 100644 --- a/reactos/subsys/win32k/objects/color.c +++ b/reactos/subsys/win32k/objects/color.c @@ -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: color.c,v 1.26 2003/10/22 14:02:54 navaraf Exp $ */ +/* $Id: color.c,v 1.27 2003/10/23 15:34:44 gvg Exp $ */ // FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping @@ -153,11 +153,6 @@ HPEN STDCALL NtGdiGetSysColorPen(int nIndex) HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex) { -#if 0 - COLORREF Col; - memcpy(&Col, COLOR_sysPalTemplate + nIndex, sizeof(COLORREF)); - return(NtGdiCreateSolidBrush(Col)); -#else static HBRUSH SysBrushes[sizeof(SysColours) / sizeof(SysColours[0])]; if (nIndex < 0 || sizeof(SysColours) / sizeof(SysColours[0]) < nIndex) @@ -166,15 +161,17 @@ HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex) return NULL; } - /* FIXME should register this object with DeleteObject() so it - can't be deleted */ + /* FIXME Should be changed when a new user logs in? */ if (NULL == SysBrushes[nIndex]) { - SysBrushes[nIndex] = (HBRUSH) ((DWORD)NtGdiCreateSolidBrush(SysColours[nIndex]) | 0x00800000); + SysBrushes[nIndex] = (HBRUSH) ((DWORD)NtGdiCreateSolidBrush(SysColours[nIndex])); + if (NULL != SysBrushes[nIndex]) + { + GDIOBJ_MarkObjectGlobal(SysBrushes[nIndex]); + } } return SysBrushes[nIndex]; -#endif }