user: change CopyImage function declaration

Oleg Krylov oleg.krylov at gmail.com
Tue Oct 3 05:07:50 CDT 2006


CopyImage function is declared to return HANDLE, not HICON in MSDN and 
PSDK headers.

Changelog:
 - Change CopyImage function declaration
Author: Oleg Krylov
License: LGPL


-------------- next part --------------
>From 48fb80a6acb98582a447b60c5016a097d283b7da Mon Sep 17 00:00:00 2001
From: Oleg Krylov <oleg.krylov at gmail.com>
Date: Mon, 2 Oct 2006 14:12:14 +0300
Subject: change CopyImage function declaration
---
 dlls/comctl32/imagelist.c |    4 ++--
 dlls/user/cursoricon.c    |    8 ++++----
 include/winuser.h         |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index faf5371..f69e4db 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -2247,14 +2247,14 @@ ImageList_ReplaceIcon (HIMAGELIST himl, 
         return -1;
     }
 
-    hBestFitIcon = CopyImage(
+    hBestFitIcon = (HICON)CopyImage(
         hIcon, IMAGE_ICON,
         himl->cx, himl->cy,
         LR_COPYFROMRESOURCE);
     /* the above will fail if the icon wasn't loaded from a resource, so try
      * again without LR_COPYFROMRESOURCE flag */
     if (!hBestFitIcon)
-        hBestFitIcon = CopyImage(
+        hBestFitIcon = (HICON)CopyImage(
             hIcon, IMAGE_ICON,
             himl->cx, himl->cy,
             0);
diff --git a/dlls/user/cursoricon.c b/dlls/user/cursoricon.c
index 1a43ebd..cad9316 100644
--- a/dlls/user/cursoricon.c
+++ b/dlls/user/cursoricon.c
@@ -2308,7 +2308,7 @@ HANDLE WINAPI LoadImageW( HINSTANCE hins
  *    if the source is a DIB section.
  *    The LR_MONOCHROME flag is ignored if LR_CREATEDIBSECTION is present.
  */
-HICON WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
+HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
                              INT desiredy, UINT flags )
 {
     TRACE("hnd=%p, type=%u, desiredx=%d, desiredy=%d, flags=%x\n",
@@ -2492,16 +2492,16 @@ HICON WINAPI CopyImage( HANDLE hnd, UINT
                 }
             }
             HeapFree(GetProcessHeap(), 0, bi);
-            return (HICON)res;
+            return (HANDLE)res;
         }
         case IMAGE_ICON:
-                return CURSORICON_ExtCopy(hnd,type, desiredx, desiredy, flags);
+                return (HANDLE)CURSORICON_ExtCopy((HICON)hnd, type, desiredx, desiredy, flags);
         case IMAGE_CURSOR:
                 /* Should call CURSORICON_ExtCopy but more testing
                  * needs to be done before we change this
                  */
                 if (flags) FIXME("Flags are ignored\n");
-                return CopyCursor(hnd);
+                return (HANDLE)CopyCursor(hnd);
     }
     return 0;
 }
diff --git a/include/winuser.h b/include/winuser.h
index 14d36e5..d5a8e9b 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4215,7 +4215,7 @@ BOOL      WINAPI CloseWindow(HWND);
 BOOL      WINAPI CloseWindowStation(HWINSTA);
 #define     CopyCursor(cur) ((HCURSOR)CopyIcon((HICON)(cur)))
 HICON     WINAPI CopyIcon(HICON);
-HICON     WINAPI CopyImage(HANDLE,UINT,INT,INT,UINT);
+HANDLE    WINAPI CopyImage(HANDLE,UINT,INT,INT,UINT);
 BOOL      WINAPI CopyRect(RECT*,const RECT*);
 INT       WINAPI CountClipboardFormats(void);
 BOOL      WINAPI CreateCaret(HWND,HBITMAP,INT,INT);
-- 
1.4.1.1



More information about the wine-patches mailing list