Fix ownership of driver-created palettes

svn path=/trunk/; revision=6804
This commit is contained in:
Gé van Geldorp 2003-11-26 22:24:04 +00:00
parent 0b8af550d1
commit 1d9998a97f
2 changed files with 13 additions and 4 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -46,7 +46,15 @@ EngCreatePalette(ULONG Mode,
ULONG Green, ULONG Green,
ULONG Blue) 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 BOOL STDCALL
EngDeletePalette(IN HPALETTE Palette) EngDeletePalette(IN HPALETTE Palette)
{ {
GDIOBJ_SetOwnership(Palette, PsGetCurrentProcess());
return PALETTE_FreePalette(Palette); return PALETTE_FreePalette(Palette);
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * DC.C - Device context functions
* *
@ -617,7 +617,6 @@ IntCreatePrimarySurface()
DPRINT("Adjusting GDIInfo.ulLogPixelsY\n"); DPRINT("Adjusting GDIInfo.ulLogPixelsY\n");
PrimarySurface.GDIInfo.ulLogPixelsY = 96; PrimarySurface.GDIInfo.ulLogPixelsY = 96;
} }
GDIOBJ_SetOwnership(PrimarySurface.DevInfo.hpalDefault, NULL);
DPRINT("calling completePDev\n"); DPRINT("calling completePDev\n");