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
34136 Call user32.623: WindowFromDC(000005b6) ret=405d3d25 fs=008f
34137 Ret user32.623: WindowFromDC() retval=000014b0 ret=405d3d25 fs=008f
34138 Call user32.252: GetForegroundWindow() ret=405d3d36 fs=008f
34139 Ret user32.252: GetForegroundWindow() retval=00000454 ret=405d3d36 fs=008f
34140 Call user32.357: IsChild(00000454,000014b0) ret=405d3d49 fs=008f
34141 Ret user32.357: IsChild() retval=00000001 ret=405d3d49 fs=008f
34142 trace:palette:GDISelectPalette16 05b6 3d76
34143 Ret gdi32.429: SelectPalette() retval=0000ffef ret=00413b46 fs=008f
34144 Call gdi32.409: RealizePalette(000005b6) ret=00413b4e fs=008f
34145 trace:palette:GDIRealizePalette16 05b6...
34146 fixme:palette:GDIRealizePalette16 invalid selected palette 3d76
34147 Ret gdi32.409: RealizePalette() retval=00000000 ret=00413b4e fs=008f
Checking in SelectPalette that the Palette is valid with:
HPALETTE WINAPI SelectPalette(
HDC hDC, /* [in] Handle of device context */
HPALETTE hPal, /* [in] Handle of logical color palette */
BOOL bForceBackground) /* [in] Foreground/background mode */
{
WORD wBkgPalette = 1;
PALETTEOBJ* palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC );
if (!palPtr) {
FIXME("invalid selected palette %04x\n",hPal);
return 0;
}
GDI_ReleaseObj( hPal );
now spits out a lot of messages:
fixme:palette:SelectPalette invalid selected palette
but makes the application display as expected. Is this a sensible fix?
B.t.w., the other occurances are caused by the hpalette argument being
NULL, which happens too when running the application in windows in
vmware ( if I interpret the VC6 Debugger right)
Bye
Uwe Bonnes [EMAIL PROTECTED]
Free Software: If you contribute nothing, expect nothing
--