From a4aeb090df1e46b39018344826d77d7e6c4a6b46 Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Sun, 6 Jun 2010 19:11:52 +0000 Subject: [PATCH] [WIN32K] - Use TAG_PALETTE for palette entries - Remove mapping codes, the functions from pre r9000 don't even exist anymore svn path=/trunk/; revision=47635 --- .../subsystems/win32/win32k/include/palette.h | 5 ---- .../subsystems/win32/win32k/objects/palette.c | 26 ++++--------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/palette.h b/reactos/subsystems/win32/win32k/include/palette.h index 43f59e6efca..76839b075f5 100644 --- a/reactos/subsystems/win32/win32k/include/palette.h +++ b/reactos/subsystems/win32/win32k/include/palette.h @@ -2,8 +2,6 @@ #include -#define NO_MAPPING - #define PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual) */ #define PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */ @@ -79,9 +77,6 @@ BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody); HPALETTE FASTCALL PALETTE_Init (VOID); VOID FASTCALL PALETTE_ValidateFlags (PALETTEENTRY* lpPalE, INT size); -#ifndef NO_MAPPING -INT APIENTRY PALETTE_SetMapping(PALOBJ* palPtr, UINT uStart, UINT uNum, BOOL mapOnly); -#endif INT FASTCALL PALETTE_ToPhysical (PDC dc, COLORREF color); INT FASTCALL PALETTE_GetObject(PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer); diff --git a/reactos/subsystems/win32/win32k/objects/palette.c b/reactos/subsystems/win32/win32k/objects/palette.c index 8fcbbe4077c..e108b5c6885 100644 --- a/reactos/subsystems/win32/win32k/objects/palette.c +++ b/reactos/subsystems/win32/win32k/objects/palette.c @@ -61,9 +61,6 @@ HPALETTE FASTCALL PALETTE_Init(VOID) int i; HPALETTE hpalette; PLOGPALETTE palPtr; -#ifndef NO_MAPPING - PALOBJ *palObj; -#endif // create default palette (20 system colors) palPtr = ExAllocatePoolWithTag(PagedPool, @@ -85,19 +82,6 @@ HPALETTE FASTCALL PALETTE_Init(VOID) hpalette = NtGdiCreatePaletteInternal(palPtr,NB_RESERVED_COLORS); ExFreePoolWithTag(palPtr, TAG_PALETTE); -#ifndef NO_MAPPING - palObj = (PALOBJ*)PALETTE_LockPalette(hpalette); - if (palObj) - { - if (!(palObj->mapping = ExAllocatePool(PagedPool, sizeof(int) * 20))) - { - DbgPrint("Win32k: Can not create palette mapping -- out of memory!"); - return FALSE; - } - PALETTE_UnlockPalette(palObj); - } -#endif - /* palette_size = visual->map_entries; */ gpalRGB.Mode = PAL_RGB; @@ -232,7 +216,7 @@ PALETTE_Cleanup(PVOID ObjectBody) PPALETTE pPal = (PPALETTE)ObjectBody; if (NULL != pPal->IndexedColors) { - ExFreePool(pPal->IndexedColors); + ExFreePoolWithTag(pPal->IndexedColors, TAG_PALETTE); } return TRUE; @@ -453,7 +437,7 @@ NtGdiCreatePaletteInternal ( IN LPLOGPALETTE pLogPal, IN UINT cEntries ) else { /* FIXME - Handle PalGDI == NULL!!!! */ - DPRINT1("waring PalGDI is NULL \n"); + DPRINT1("PalGDI is NULL\n"); } return NewPalette; } @@ -981,7 +965,7 @@ NtGdiDoPalette( if (pUnsafeEntries) { - pEntries = ExAllocatePool(PagedPool, cEntries * sizeof(PALETTEENTRY)); + pEntries = ExAllocatePoolWithTag(PagedPool, cEntries * sizeof(PALETTEENTRY), TAG_PALETTE); if (!pEntries) return 0; if (bInbound) @@ -993,7 +977,7 @@ NtGdiDoPalette( } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ExFreePool(pEntries); + ExFreePoolWithTag(pEntries, TAG_PALETTE); _SEH2_YIELD(return 0); } _SEH2_END @@ -1047,7 +1031,7 @@ NtGdiDoPalette( } _SEH2_END } - ExFreePool(pEntries); + ExFreePoolWithTag(pEntries, TAG_PALETTE); } return ret;