gdi32 : Questions about SetDIBColorTable and GetDIBColorTable

Alexandre Julliard julliard at
Mon Apr 16 10:46:47 CDT 2007

Laurent Vromman <laurent at> writes:

> Whatever happen next, the local implementation is used. Then if
> pGetDIBColorTable is available, it is used too. I see here a second
> call for the same thing, even if the local implementation
> succeed. Moreover, the result of dc->funcs->pGetDIBColorTable is not
> used as a return value.  Is there a mistake here, or is there
> something I do not understand ?
> GetDIBColorTable uses the local implementation only if dc->funcs is
> not available. That is not the case for SetDIBColorTable, which runs
> first the local implementation.  What is the right policy to apply
> here ?

Both are correct. gdi32 always stores the color table, so it has to be
updated upon SetDIBColorTable no matter what the driver does; while
GetDIBColorTable doesn't need to access it if the driver has a better
way of doing it. This way the driver can either:

1. not implement anything, get and set are handled by gdi32;
2. let gdi32 maintain the local copy but still do something when the
   color table is changed;
3. implemented both set and get to override gdi32 completely.

Alexandre Julliard
julliard at

More information about the wine-devel mailing list