[0.4.10][WIN32K] Revert incorrect part of R50928 for RealizePalette. (#3678)
authorJoachim Henze <Joachim.Henze@reactos.org>
Wed, 12 Jan 2022 05:00:26 +0000 (06:00 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Wed, 12 Jan 2022 05:00:26 +0000 (06:00 +0100)
Revert part of SVN R50928 that causes Durak card suites to have wrong colors.
SVN r50928 == git 5de8339cd196e2bc01ac631e677010a939b2d083

JIRA issue: CORE-13748 <= Durak Example
JIRA issue: CORE-16510 <= GDIProg Example

The idea was picked from 0.4.15-dev-2735-g c7954134d0d60100911b8872d3605fbb576d968d
but I was too shy to port the recurrently spamming and slowing DPRINT1 back that far.
Spamming on master should be enough to improve here later.

win32ss/gdi/ntgdi/palette.c

index ef45091..beb3648 100644 (file)
@@ -727,7 +727,7 @@ UINT
 FASTCALL
 IntGdiRealizePalette(HDC hDC)
 {
-    UINT i, realize = 0;
+    UINT realize = 0;
     PDC pdc;
     PALETTE *ppalSurf, *ppalDC;
 
@@ -766,13 +766,6 @@ IntGdiRealizePalette(HDC hDC)
 
     ASSERT(ppalDC->flFlags & PAL_INDEXED);
 
-    // FIXME: Should we resize ppalSurf if it's too small?
-    realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors;
-
-    for (i=0; i<realize; i++)
-    {
-        InterlockedExchange((LONG*)&ppalSurf->IndexedColors[i], *(LONG*)&ppalDC->IndexedColors[i]);
-    }
 
 cleanup:
     DC_UnlockDc(pdc);