[Win32SS]
authorJames Tabor <james.tabor@reactos.org>
Tue, 22 Nov 2016 04:46:58 +0000 (04:46 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 22 Nov 2016 04:46:58 +0000 (04:46 +0000)
- Patch by Katayama Hirofumi MZ : Improves NC_IconForWindow function. See CORE-12129.

svn path=/trunk/; revision=73334

reactos/win32ss/user/ntuser/nonclient.c

index ff45e97..d28577a 100644 (file)
@@ -613,11 +613,6 @@ PCURICON_OBJECT FASTCALL NC_IconForWindow( PWND pWnd )
     PCURICON_OBJECT pIcon = NULL;
     HICON hIcon;
 
     PCURICON_OBJECT pIcon = NULL;
     HICON hIcon;
 
-   //FIXME: Some callers use this function as if it returns a boolean saying "this window has an icon".
-   //FIXME: Hence we must return a pointer with no reference count.
-   //FIXME: This is bad and we should feel bad.
-   //FIXME: Stop whining over wine code.
-
    hIcon = UserGetProp(pWnd, gpsi->atomIconSmProp, TRUE);
    if (!hIcon) hIcon = UserGetProp(pWnd, gpsi->atomIconProp, TRUE);
 
    hIcon = UserGetProp(pWnd, gpsi->atomIconSmProp, TRUE);
    if (!hIcon) hIcon = UserGetProp(pWnd, gpsi->atomIconProp, TRUE);
 
@@ -636,11 +631,9 @@ PCURICON_OBJECT FASTCALL NC_IconForWindow( PWND pWnd )
    }
    if (hIcon)
    {
    }
    if (hIcon)
    {
-       pIcon = UserGetCurIconObject(hIcon);
-       if (pIcon)
-       {
-           UserDereferenceObject(pIcon);
-       }
+       pIcon = (PCURICON_OBJECT)UserGetObjectNoErr(gHandleTable,
+                                                   hIcon,
+                                                   TYPE_CURSOR);
    }
    return pIcon;
 }
    }
    return pIcon;
 }