Author: hbelusca Date: Sun Oct 13 16:21:55 2013 New Revision: 60641
URL: http://svn.reactos.org/svn/reactos?rev=60641&view=rev Log: [CONSRV]: Move the palette hack.
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] Sun Oct 13 16:21:55 2013 @@ -237,45 +237,14 @@ { BOOL Success;
-/******************************************************************************\ -|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| -******************************************************************************/ - -#define PALETTESIZE 256 - - UINT i; - LPLOGPALETTE LogPalette; /* Pointer to logical palette */ - -PALETTEENTRY MyPalette[] = -{ {0, 0, 0x80,0} , // 1 - {0, 0x80,0, 0} , // 2 - {0, 0, 0, 0} , // 0 - {0, 0x80,0x80,0} , // 3 - {0x80,0, 0, 0} , // 4 - {0x80,0, 0x80,0} , // 5 - {0x80,0x80,0, 0} , // 6 - {0xC0,0xC0,0xC0,0} , // 7 - {0x80,0x80,0x80,0} , // 8 - {0, 0, 0xFF,0} , // 9 - {0, 0xFF,0, 0} , // 10 - {0, 0xFF,0xFF,0} , // 11 - {0xFF,0, 0, 0} , // 12 - {0xFF,0, 0xFF,0} , // 13 - {0xFF,0xFF,0, 0} , // 14 - {0xFF,0xFF,0xFF,0} }; // 15 - -/******************************************************************************\ -|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| -******************************************************************************/ - - DPRINT1("ConDrvSetConsolePalette checkpt 0\n"); - + DPRINT1("ConDrvSetConsolePalette\n"); + + /* + * Parameters validation + */ if (Console == NULL || Buffer == NULL) return STATUS_INVALID_PARAMETER;
- DPRINT1("ConDrvSetConsolePalette checkpt 1\n"); - - // FIXME: Is it useful ? if ( PaletteUsage != SYSPAL_STATIC && PaletteUsage != SYSPAL_NOSTATIC && PaletteUsage != SYSPAL_NOSTATIC256 ) @@ -283,48 +252,8 @@ return STATUS_INVALID_PARAMETER; }
- DPRINT1("ConDrvSetConsolePalette checkpt 2\n"); - - /* Validity check */ - ASSERT(Console == Buffer->Header.Console); - - - -/******************************************************************************\ -|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| -******************************************************************************/ - - DPRINT1("HACK: FIXME: ConDrvSetConsolePalette - Use hacked palette for testing purposes!!\n"); - - LogPalette = (LPLOGPALETTE)ConsoleAllocHeap(HEAP_ZERO_MEMORY, - (sizeof(LOGPALETTE) + - (sizeof(PALETTEENTRY) * PALETTESIZE))); - - if (LogPalette) - { - LogPalette->palVersion = 0x300; - LogPalette->palNumEntries = PALETTESIZE; - - for(i=0; i < PALETTESIZE;i++) - { - LogPalette->palPalEntry[i] = MyPalette[i % sizeof(MyPalette)/sizeof(MyPalette[0])]; - } - - PaletteHandle = CreatePalette(LogPalette); - PaletteUsage = SYSPAL_NOSTATIC256; - ConsoleFreeHeap(LogPalette); - } - else - { - DPRINT1("ConDrvSetConsolePalette - Hacked LogPalette is NULL\n"); - } - -/******************************************************************************\ -|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| -******************************************************************************/ - - - + /* Validity check */ + ASSERT(Console == Buffer->Header.Console);
/* Change the palette */ DPRINT1("ConDrvSetConsolePalette calling TermSetPalette\n");
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Sun Oct 13 16:21:55 2013 @@ -62,6 +62,37 @@ PCONSOLE_SETPALETTE SetPaletteRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetPaletteRequest; // PGRAPHICS_SCREEN_BUFFER Buffer; PCONSOLE_SCREEN_BUFFER Buffer; + + +/******************************************************************************\ +|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| +******************************************************************************/ + +#define PALETTESIZE 256 + + LPLOGPALETTE LogPalette; /* Pointer to logical palette */ + PALETTEENTRY MyPalette[] = + { {0, 0, 0x80,0} , // 1 + {0, 0x80,0, 0} , // 2 + {0, 0, 0, 0} , // 0 + {0, 0x80,0x80,0} , // 3 + {0x80,0, 0, 0} , // 4 + {0x80,0, 0x80,0} , // 5 + {0x80,0x80,0, 0} , // 6 + {0xC0,0xC0,0xC0,0} , // 7 + {0x80,0x80,0x80,0} , // 8 + {0, 0, 0xFF,0} , // 9 + {0, 0xFF,0, 0} , // 10 + {0, 0xFF,0xFF,0} , // 11 + {0xFF,0, 0, 0} , // 12 + {0xFF,0, 0xFF,0} , // 13 + {0xFF,0xFF,0, 0} , // 14 + {0xFF,0xFF,0xFF,0} }; // 15 + +/******************************************************************************\ +|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| +******************************************************************************/ +
DPRINT1("SrvSetConsolePalette\n");
@@ -80,6 +111,42 @@ &Buffer, GENERIC_WRITE, TRUE); if (!NT_SUCCESS(Status)) return Status;
+ +/******************************************************************************\ +|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| +******************************************************************************/ + + DPRINT1("HACK: FIXME: SrvSetConsolePalette - Use hacked palette for testing purposes!!\n"); + + LogPalette = (LPLOGPALETTE)ConsoleAllocHeap(HEAP_ZERO_MEMORY, + (sizeof(LOGPALETTE) + + (sizeof(PALETTEENTRY) * PALETTESIZE))); + if (LogPalette) + { + UINT i; + + LogPalette->palVersion = 0x300; + LogPalette->palNumEntries = PALETTESIZE; + + for (i = 0 ; i < PALETTESIZE ; i++) + { + LogPalette->palPalEntry[i] = MyPalette[i % sizeof(MyPalette)/sizeof(MyPalette[0])]; + } + + SetPaletteRequest->PaletteHandle = CreatePalette(LogPalette); + SetPaletteRequest->Usage = SYSPAL_NOSTATIC256; + ConsoleFreeHeap(LogPalette); + } + else + { + DPRINT1("SrvSetConsolePalette - Hacked LogPalette is NULL\n"); + } + +/******************************************************************************\ +|************** HACK! HACK! HACK! HACK! HACK! HACK! HACK! HACK! ***************| +******************************************************************************/ + + DPRINT1("ConDrvSetConsolePalette calling...\n");
Status = ConDrvSetConsolePalette(Buffer->Header.Console,