2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: GDI Palette Functions
5 * FILE: subsys/win32k/eng/palette.c
6 * PROGRAMER: Jason Filby
11 #include <ddk/winddi.h>
12 #include <include/object.h>
16 #include <win32k/debug1.h>
19 EngCreatePalette(ULONG Mode,
29 NewPalette = (HPALETTE)CreateGDIHandle(sizeof(PALGDI), sizeof(PALOBJ));
30 if( !ValidEngHandle( NewPalette ) )
33 PalGDI = (PALGDI*) AccessInternalObject( (ULONG) NewPalette );
40 PalGDI->IndexedColors = ExAllocatePool(NonPagedPool, sizeof(PALETTEENTRY) * NumColors);
41 RtlCopyMemory(PalGDI->IndexedColors, Colors, sizeof(PALETTEENTRY) * NumColors);
46 PalGDI->NumColors = NumColors;
48 if(Mode==PAL_BITFIELDS)
50 PalGDI->RedMask = Red;
51 PalGDI->GreenMask = Green;
52 PalGDI->BlueMask = Blue;
59 EngDeletePalette(IN HPALETTE Palette)
61 FreeGDIHandle((ULONG)Palette);
66 PALOBJ_cGetColors(PALOBJ *PalObj,
74 PalGDI = (PALGDI*)AccessInternalObjectFromUserObject(PalObj);
76 for(i=Start; i<Colors; i++)
78 PaletteEntry[i] = PalGDI->IndexedColors[i];