Module: wine Branch: master Commit: 2854884a428e222cbb9078d875068a72f25365c4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2854884a428e222cbb9078d875... Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Thu Oct 22 13:15:30 2009 +0400 gdi32: Always create a context for DIB_RGB_COLORS. --- dlls/gdi32/dib.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 3b1ba92..767c0a9 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -336,17 +336,17 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, BITMAPOBJ *bitmap; INT result = 0; + if (coloruse == DIB_RGB_COLORS) hdc = CreateCompatibleDC(0); + if (!(dc = get_dc_ptr( hdc ))) - { - if (coloruse == DIB_RGB_COLORS) FIXME( "shouldn't require a DC for DIB_RGB_COLORS\n" ); return 0; - } update_dc( dc ); if (!(bitmap = GDI_GetObjPtr( hbitmap, OBJ_BITMAP ))) { release_dc_ptr( dc ); + if (coloruse == DIB_RGB_COLORS) DeleteDC(hdc); return 0; } @@ -365,6 +365,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, done: GDI_ReleaseObj( hbitmap ); release_dc_ptr( dc ); + if (coloruse == DIB_RGB_COLORS) DeleteDC(hdc); return result; }