Mike Kaplinskiy : user32: Fix color mask handling in CreateIconIndirect.

Alexandre Julliard julliard at winehq.org
Mon Dec 21 09:39:51 CST 2009


Module: wine
Branch: master
Commit: 075a1e0e4db2934fd7413e9d5098360dd3cc5e6d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=075a1e0e4db2934fd7413e9d5098360dd3cc5e6d

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Mon Dec 21 00:25:10 2009 -0500

user32: Fix color mask handling in CreateIconIndirect.

---

 dlls/user32/cursoricon.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 248f3a0..631c469 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -2218,24 +2218,24 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
         }
         else
         {
-            HDC hdc, hdc_mem;
-            HBITMAP hbmp_old, hbmp_mem_old, hbmp_mono;
+            HDC hdc_mem, hdc_mem2;
+            HBITMAP hbmp_mem_old, hbmp_mem2_old, hbmp_mono;
 
-            hdc = GetDC( 0 );
-            hdc_mem = CreateCompatibleDC( hdc );
+            hdc_mem = CreateCompatibleDC( 0 );
+            hdc_mem2 = CreateCompatibleDC( 0 );
 
             hbmp_mono = CreateBitmap( bmpAnd.bmWidth, bmpAnd.bmHeight, 1, 1, NULL );
 
-            hbmp_old = SelectObject( hdc, iconinfo->hbmMask );
-            hbmp_mem_old = SelectObject( hdc_mem, hbmp_mono );
+            hbmp_mem_old = SelectObject( hdc_mem, iconinfo->hbmMask );
+            hbmp_mem2_old = SelectObject( hdc_mem2, hbmp_mono );
 
-            BitBlt( hdc_mem, 0, 0, bmpAnd.bmWidth, bmpAnd.bmHeight, hdc, 0, 0, SRCCOPY );
+            BitBlt( hdc_mem2, 0, 0, bmpAnd.bmWidth, bmpAnd.bmHeight, hdc_mem, 0, 0, SRCCOPY );
 
-            SelectObject( hdc, hbmp_old );
             SelectObject( hdc_mem, hbmp_mem_old );
+            SelectObject( hdc_mem2, hbmp_mem2_old );
 
             DeleteDC( hdc_mem );
-            ReleaseDC( 0, hdc );
+            DeleteDC( hdc_mem2 );
 
             GetBitmapBits( hbmp_mono, sizeAnd, info + 1 );
             DeleteObject( hbmp_mono );




More information about the wine-cvs mailing list