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