I was investigating a crashing problem launching Sid Meier's Alpha
Centauri last night, and I came across a problem in the implementation
of CreateDIBSection() that's causing a crash. Here's the problem - the
biSizeImage field of the BITMAPINFOHEADER that's passed to
CreateDIBSection is being used to size the memory block for the image
data if it is non-zero. This seems to not be the way that Windows (98,
98SE, and 2K are what I've tested on) works, since the game works on all
three of those OS's. SMAC is passing 1024 as the biSizeImage field,
which is somewhat goofy, but apparently legal. Once a trivial change is
made to graphics/x11drv/dib.c, the game runs, although it's not colored
correctly.
I've looked at the documentation for CreateDIBSection() on
msdn.microsoft.com, and it looks like you're always supposed to use the
other fields (width, height, pixel format) to determine the size. As
usual, though, the MS documentation is extremely unhelpful for "knowing"
whether or not this is right.
Basically, I believe that the biSizeImage field should only be used in
an "out" fashion, if at all.
There are a number of files where this field is being used (recursive
grep), and I thought I would ask if a Wine development newbie like
myself should actually be submitting his first patch on a fix that may
affect about a dozen files. If you want me to submit the patches, just
let me know and I'll be able to do it tonight.
Thanks in advance for any help/advice!
- Ken.
[EMAIL PROTECTED]