At 09:00 PM 9/9/00 +0200, you wrote:
>Hallo,
>
>some application (likse32.exe for viewing the Harris Data book CD)
>displays only a small part of what it is supposed to display, but a
>lot of black pixels and spits out a lot of messages:
>
>GDIRealizePalette16 invalid selected palette
>
>The first occurance is as follows:
>...
> 12407 Call gdi32.160: CreatePalette(41a4f55c) ret=0041bc84 fs=008f
> 12408 trace:palette:CreatePalette entries=256
> 12409 trace:palette:CreatePalette returning 3d76
> 12410 Ret gdi32.160: CreatePalette() retval=00003d76 ret=0041bc84 fs=008f
>...
> 34131 Call gdi32.177: DeleteObject(00003d76) ret=0041e13d fs=008f
> 34132 Ret gdi32.177: DeleteObject() retval=00000001 ret=0041e13d fs=008f
> 34133 Call user32.241: GetDC(000014b0) ret=00417814 fs=008f
> 34134 Ret user32.241: GetDC() retval=000005b6 ret=00417814 fs=008f
> 34135 Call gdi32.429: SelectPalette(000005b6,00003d76,00000000) ret=00413b46 fs=008f
IMHO your fix is correct in principle, Windows is making tons of parameter
validation everywhere and IIRC Alexandre Julliard has said that although he did not
want such code added systematically to mimic Windows, he did not object
to fix specific not working applications, even if because of a bug (as it seems to
be the case here)
About implementation, you can use also something like
if (GetObjectType(handle) == PALETTE_MAGIC)
Gerard