Alexandre Julliard : user32: Return the module and resource name in GetIconInfoEx.

Alexandre Julliard julliard at winehq.org
Mon Oct 11 13:15:13 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 11 12:53:36 2010 +0200

user32: Return the module and resource name in GetIconInfoEx.

---

 dlls/user32/cursoricon.c       |   12 +++++++++---
 dlls/user32/tests/cursoricon.c |   12 ++++++------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index c88bc53..1efe78e 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1911,9 +1911,15 @@ BOOL WINAPI GetIconInfoExW( HICON icon, ICONINFOEXW *info )
     info->yHotspot     = ptr->hotspot.y;
     info->hbmColor     = copy_bitmap( ptr->frames[0].color );
     info->hbmMask      = copy_bitmap( ptr->frames[0].mask );
-    info->wResID       = 0;  /* FIXME */
-    info->szModName[0] = 0;  /* FIXME */
-    info->szResName[0] = 0;  /* FIXME */
+    info->wResID       = 0;
+    info->szModName[0] = 0;
+    info->szResName[0] = 0;
+    if (ptr->module)
+    {
+        GetModuleFileNameW( ptr->module, info->szModName, MAX_PATH );
+        if (IS_INTRESOURCE( ptr->resname )) info->wResID = LOWORD( ptr->resname );
+        else lstrcpynW( info->szResName, ptr->resname, MAX_PATH );
+    }
     release_icon_ptr( icon, ptr );
     return TRUE;
 }
diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c
index 446bdf9..10f0037 100644
--- a/dlls/user32/tests/cursoricon.c
+++ b/dlls/user32/tests/cursoricon.c
@@ -956,20 +956,20 @@ static void test_LoadImage(void)
         infoexA.cbSize = sizeof(infoexA);
         ret = pGetIconInfoExA( handle, &infoexA );
         ok( ret, "GetIconInfoEx failed err %d\n", GetLastError() );
-        todo_wine ok( infoexA.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexA.wResID );
+        ok( infoexA.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexA.wResID );
         /* the A version is broken on 64-bit, it truncates the string after the first char */
         if (is_win64 && infoexA.szModName[0] && infoexA.szModName[1] == 0)
             trace( "GetIconInfoExA broken on Win64\n" );
         else
-            todo_wine ok( GetModuleHandleA(infoexA.szModName) == GetModuleHandleA("user32.dll"),
-                          "GetIconInfoEx wrong module %s\n", infoexA.szModName );
+            ok( GetModuleHandleA(infoexA.szModName) == GetModuleHandleA("user32.dll"),
+                "GetIconInfoEx wrong module %s\n", infoexA.szModName );
         ok( infoexA.szResName[0] == 0, "GetIconInfoEx wrong name %s\n", infoexA.szResName );
         infoexW.cbSize = sizeof(infoexW);
         ret = pGetIconInfoExW( handle, &infoexW );
         ok( ret, "GetIconInfoEx failed err %d\n", GetLastError() );
-        todo_wine ok( infoexW.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexW.wResID );
-        todo_wine ok( GetModuleHandleW(infoexW.szModName) == GetModuleHandleA("user32.dll"),
-                      "GetIconInfoEx wrong module %s\n", wine_dbgstr_w(infoexW.szModName) );
+        ok( infoexW.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexW.wResID );
+        ok( GetModuleHandleW(infoexW.szModName) == GetModuleHandleA("user32.dll"),
+            "GetIconInfoEx wrong module %s\n", wine_dbgstr_w(infoexW.szModName) );
         ok( infoexW.szResName[0] == 0, "GetIconInfoEx wrong name %s\n", wine_dbgstr_w(infoexW.szResName) );
     }
     SetLastError(0xdeadbeef);




More information about the wine-cvs mailing list