Fix ownership of driver-created palettes
authorGé van Geldorp <ge@gse.nl>
Wed, 26 Nov 2003 22:24:04 +0000 (22:24 +0000)
committerGé van Geldorp <ge@gse.nl>
Wed, 26 Nov 2003 22:24:04 +0000 (22:24 +0000)
svn path=/trunk/; revision=6804

reactos/subsys/win32k/eng/palette.c
reactos/subsys/win32k/objects/dc.c

index d0a896d..1f7254e 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: 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);
 }
 
index 3ffdbcb..8ef0476 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.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");