X11DRV - Fix Subtle DIB Losing Changes Bug

Robert Shearman rob at codeweavers.com
Mon Nov 22 09:29:47 CST 2004


This bug was very subtle. It only occurs after a specific sequence of 
changes of state in the DIB state machine and results in the most recent 
set of changes being lost. It is caused by DIB_Status_GdiMod not storing 
its previous status. Here is the sequence that triggers the bug:
1) Application reads from DIB bits. (dib->status = DIB_Status_InSync, 
dib->p_status = ?)
2) Applications does some GDI operation that causes a change to the DIB 
(dib->status = DIB_Status_GdiMod, dib->p_status = DIB_Status_InSync).
3) Application does another GDI operation that doesn't change the DIB 
(dib->status = DIB_Status_GdiMod, dib->p_status = DIB_Status_InSync).
3a) Because the operation didn't change the DIB, it reverts to its 
previously stored state (dib->status = DIB_Status_InSync, dib->p_status 
= DIB_Status_InSync).
Therefore, any changes in (2) become lost.
This patch fixes the above case.

When changing from DIB_Status_GdiMod to DIB_Status_GdiMod, we have to 
set the previous status to DIB_Status_GdiMod, otherwise a non-committing 
unlock could incorrectly revert the DIB to another state, rather than 
the correct DIB_Status_GdiMod.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dib.diff
Type: text/x-patch
Size: 524 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20041122/4770fd6b/dib.bin

More information about the wine-patches mailing list