[ros-dev] [ros-diffs] [jgardou] 48359: [WIN32K] - Rewrite NtGdiGetDIBitsInternal, with WINE as a reference. - Get back DIB Section creation to classic BITMAPINFO. This si the beginnig of the end for all this BITMAPV5INFO stuff. It is horrible, BITMAPCOREINFO->

Timo Kreuzer timo.kreuzer at web.de
Sun Aug 1 15:56:23 UTC 2010


Jérôme Gardou schrieb:
> That's why I began to revert all of this stuff, which is horrible :-)

While I completely agree on removing BITMAPCOREHEADER support, I don't
really like other parts.

- Probing the BITMAPINFO and then passing the usermode buffer to the
internal and unprotected function is not enough. The buffer must be copied.
- The BITMAPV5HEADER is only ~120 bytes and only used once per function
call, so putting the safe buffer on the stack is appropriate. The buffer
needs be large enough for V5 anyway, so why not fixup some values and
make it a full V5 header?
- The ProbeAndConvert function was added to simplify the code and move
all code that handles the small differences into one central place
instead of having a bunch of if (size > bla) checks in multiple places
just to check whether I can or can not access some member of the
BITMAPINFO or where to get the color masks from. With the conversion all
of the internal code can work the same simple way assuming a full
BITMAPV5INFO is available.
- When support for BITMAPCOREHEADER gets removed the code become much
less "horrible"

Timo




More information about the Ros-dev mailing list