Palettes - Any experts?

Ann and Jason Edmeades us at
Mon Apr 14 15:44:06 CDT 2003

Hello, Having taken a break for a few months I thought I'd try playing with
wine again...

I have been trying to work out why one game I am investigating never even
shows its splash screen, and have got most of the way until I have got
stuck. Can anyone offer me some advice?

The game launcher kicks off a process whose first thread creates a dummy
16x16 window which is placed in the center of the screen (who knows why!),
and launches another thread. The main thread then proceeds to create another
process, and wait for it to complete. This means the dummy window is not
processing any messages and if sent any the whole thing hangs :-(

The launched thread creates the splash screen and begins a WM_PAINT
operation. During this processing it calls CreateCompatibleDC, SelectObject,
SelectPalette and finally RealizePalette

This RealizePalette call (UserRealizePalette, windows\painting.c) results in
256 colors being mapped in, and SendMessageA( HWND_BROADCAST,
WM_PALETTECHANGED, (WPARAM)hWnd, 0L); to occur. This broadcast hangs
attempting to send the message to the first thread as it is in a hung state
waiting for another process to end. Under windows, the RealizePalette
returns 0, and spy on Windows does not show this message being sent to the
'hung' thread.

'Interestingly', putting an xterm behind the splash panel, and trying to
bring it to the front (to force a repaint) shows that UserRealizePalette is
always returning 256, which I thing is the underlying bug. It appears to
create a palette every WM_PAINT operation.

Commenting out the broadcast makes the splashscreen appear perfectly, so I
know I am along the right lines.

Can anyone fill in some gaps and point me in the right direction? Debug logs
willingly available! :-)


More information about the wine-devel mailing list