Commit c9376343 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

gdi32: GetPaletteEntries should not filter peFlags (test included).

parent 1fa9e526
......@@ -300,9 +300,6 @@ UINT WINAPI GetPaletteEntries(
}
memcpy( entries, &palPtr->logpalette.palPalEntry[start],
count * sizeof(PALETTEENTRY) );
for( numEntries = 0; numEntries < count ; numEntries++ )
if (entries[numEntries].peFlags & 0xF0)
entries[numEntries].peFlags = 0;
}
GDI_ReleaseObj( hpalette );
......
......@@ -120,7 +120,33 @@ static void test_DIB_PAL_COLORS(void) {
ReleaseDC( NULL, hdc );
}
static void test_palette_entries(void)
{
char logpalettebuf[sizeof(LOGPALETTE) + sizeof(logpalettedata)];
PLOGPALETTE logpalette = (PLOGPALETTE)logpalettebuf;
HPALETTE hpal;
UINT res=0;
PALETTEENTRY palEntry = { 0x1, 0x2, 0x3, 0xff };
PALETTEENTRY getEntryResult;
/* Initalize the logical palette with a few colours */
logpalette->palVersion = 0x300;
logpalette->palNumEntries = 8;
memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) );
hpal = CreatePalette( logpalette );
/* Set a new entry with peFlags to 0xff */
SetPaletteEntries(hpal, 0, 1, &palEntry);
/* Retrieve the entry to see if GDI32 performs any filtering on peFlags */
res = GetPaletteEntries(hpal, 0, 1, &getEntryResult);
ok(res == 1, "GetPaletteEntries should have returned 1 but returned %d\n", res);
ok( palEntry.peFlags == getEntryResult.peFlags, "palEntry.peFlags (%#x) != getEntryResult.peFlags (%#x)\n", palEntry.peFlags, getEntryResult.peFlags );
}
START_TEST(palette)
{
test_DIB_PAL_COLORS();
test_palette_entries();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment