Alexandre Julliard : user32: Reimplement CopyIcon16/ CopyCursor16 using CreateCursorIconIndirect16.

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


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 21 14:12:57 2009 +0100

user32: Reimplement CopyIcon16/CopyCursor16 using CreateCursorIconIndirect16.

---

 dlls/user32/cursoricon.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 37bbcda..ce0de37 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1557,8 +1557,12 @@ HGLOBAL16 WINAPI CreateCursorIconIndirect16( HINSTANCE16 hInstance,
  */
 HICON16 WINAPI CopyIcon16( HINSTANCE16 hInstance, HICON16 hIcon )
 {
-    TRACE_(icon)("%04x %04x\n", hInstance, hIcon );
-    return HICON_16(CURSORICON_Copy(hInstance, HICON_32(hIcon)));
+    CURSORICONINFO *info = GlobalLock16( hIcon );
+    void *and_bits = info + 1;
+    void *xor_bits = (BYTE *)and_bits + info->nHeight * get_bitmap_width_bytes( info->nWidth, 1 );
+    HGLOBAL16 ret = CreateCursorIconIndirect16( hInstance, info, and_bits, xor_bits );
+    GlobalUnlock16( hIcon );
+    return ret;
 }
 
 
@@ -1577,10 +1581,15 @@ HICON WINAPI CopyIcon( HICON hIcon )
  */
 HCURSOR16 WINAPI CopyCursor16( HINSTANCE16 hInstance, HCURSOR16 hCursor )
 {
-    TRACE_(cursor)("%04x %04x\n", hInstance, hCursor );
-    return HICON_16(CURSORICON_Copy(hInstance, HCURSOR_32(hCursor)));
+    CURSORICONINFO *info = GlobalLock16( hCursor );
+    void *and_bits = info + 1;
+    void *xor_bits = (BYTE *)and_bits + info->nHeight * get_bitmap_width_bytes( info->nWidth, 1 );
+    HGLOBAL16 ret = CreateCursorIconIndirect16( hInstance, info, and_bits, xor_bits );
+    GlobalUnlock16( hCursor );
+    return ret;
 }
 
+
 /**********************************************************************
  *		DestroyIcon32 (USER.610)
  *




More information about the wine-cvs mailing list