From 1d9998a97fd6ee92290daaf3c1d9b8aac9d62672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Wed, 26 Nov 2003 22:24:04 +0000 Subject: [PATCH] Fix ownership of driver-created palettes svn path=/trunk/; revision=6804 --- reactos/subsys/win32k/eng/palette.c | 14 ++++++++++++-- reactos/subsys/win32k/objects/dc.c | 3 +-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/reactos/subsys/win32k/eng/palette.c b/reactos/subsys/win32k/eng/palette.c index d0a896d1634..1f7254e03c0 100644 --- a/reactos/subsys/win32k/eng/palette.c +++ b/reactos/subsys/win32k/eng/palette.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: palette.c,v 1.18 2003/09/25 14:32:55 fireball Exp $ +/* $Id: palette.c,v 1.19 2003/11/26 22:24:04 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -46,7 +46,15 @@ EngCreatePalette(ULONG Mode, ULONG Green, ULONG Blue) { - return PALETTE_AllocPalette(Mode, NumColors, Colors, Red, Green, Blue); + HPALETTE Palette; + + Palette = PALETTE_AllocPalette(Mode, NumColors, Colors, Red, Green, Blue); + if (NULL != Palette) + { + GDIOBJ_SetOwnership(Palette, NULL); + } + + return Palette; } /* @@ -55,6 +63,8 @@ EngCreatePalette(ULONG Mode, BOOL STDCALL EngDeletePalette(IN HPALETTE Palette) { + GDIOBJ_SetOwnership(Palette, PsGetCurrentProcess()); + return PALETTE_FreePalette(Palette); } diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index 3ffdbcba350..8ef0476bfd5 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.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: dc.c,v 1.102 2003/11/26 21:48:35 gvg Exp $ +/* $Id: dc.c,v 1.103 2003/11/26 22:24:04 gvg Exp $ * * DC.C - Device context functions * @@ -617,7 +617,6 @@ IntCreatePrimarySurface() DPRINT("Adjusting GDIInfo.ulLogPixelsY\n"); PrimarySurface.GDIInfo.ulLogPixelsY = 96; } - GDIOBJ_SetOwnership(PrimarySurface.DevInfo.hpalDefault, NULL); DPRINT("calling completePDev\n");