From 6e7846e33e3b9ab8a0995842863b4d75ae5f2663 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 11 Oct 2010 12:53:36 +0200 Subject: [PATCH] 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 c88bc53d6db..1efe78e81ec 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 446bdf93c26..10f0037b72a 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);