Author: gedmurphy
Date: Mon Dec 17 19:31:10 2007
New Revision: 31291
URL:
http://svn.reactos.org/svn/reactos?rev=31291&view=rev
Log:
- Don't leak bitmaps in the CopyIcon call.
- Pass the call on, don't call straight into win32k
Modified:
trunk/reactos/dll/win32/user32/windows/icon.c
Modified: trunk/reactos/dll/win32/user32/windows/icon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/icon.c (original)
+++ trunk/reactos/dll/win32/user32/windows/icon.c Mon Dec 17 19:31:10 2007
@@ -35,6 +35,7 @@
/* FUNCTIONS *****************************************************************/
+
HICON
ICON_CreateIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired,
int cyDesired, int xHotspot, int yHotspot)
{
@@ -147,16 +148,19 @@
*/
HICON
STDCALL
-CopyIcon(
- HICON hIcon)
-{
- ICONINFO IconInfo;
-
- if(GetIconInfo((HANDLE)hIcon, &IconInfo))
- {
- return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
- }
- return (HICON)0;
+CopyIcon(HICON hIcon)
+{
+ HICON hRetIcon = NULL;
+ ICONINFO IconInfo;
+
+ if(GetIconInfo(hIcon, &IconInfo))
+ {
+ hRetIcon = CreateIconIndirect(&IconInfo);
+ DeleteObject(IconInfo.hbmColor);
+ DeleteObject(IconInfo.hbmMask);
+ }
+
+ return hRetIcon;
}