user32: Return the module and resource name in GetIconInfoEx.

This commit is contained in:
Alexandre Julliard 2010-10-11 12:53:36 +02:00
parent 751a09e983
commit 6e7846e33e
2 changed files with 15 additions and 9 deletions

View File

@ -1911,9 +1911,15 @@ BOOL WINAPI GetIconInfoExW( HICON icon, ICONINFOEXW *info )
info->yHotspot = ptr->hotspot.y; info->yHotspot = ptr->hotspot.y;
info->hbmColor = copy_bitmap( ptr->frames[0].color ); info->hbmColor = copy_bitmap( ptr->frames[0].color );
info->hbmMask = copy_bitmap( ptr->frames[0].mask ); info->hbmMask = copy_bitmap( ptr->frames[0].mask );
info->wResID = 0; /* FIXME */ info->wResID = 0;
info->szModName[0] = 0; /* FIXME */ info->szModName[0] = 0;
info->szResName[0] = 0; /* FIXME */ 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 ); release_icon_ptr( icon, ptr );
return TRUE; return TRUE;
} }

View File

@ -956,20 +956,20 @@ static void test_LoadImage(void)
infoexA.cbSize = sizeof(infoexA); infoexA.cbSize = sizeof(infoexA);
ret = pGetIconInfoExA( handle, &infoexA ); ret = pGetIconInfoExA( handle, &infoexA );
ok( ret, "GetIconInfoEx failed err %d\n", GetLastError() ); 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 */ /* 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) if (is_win64 && infoexA.szModName[0] && infoexA.szModName[1] == 0)
trace( "GetIconInfoExA broken on Win64\n" ); trace( "GetIconInfoExA broken on Win64\n" );
else else
todo_wine ok( GetModuleHandleA(infoexA.szModName) == GetModuleHandleA("user32.dll"), ok( GetModuleHandleA(infoexA.szModName) == GetModuleHandleA("user32.dll"),
"GetIconInfoEx wrong module %s\n", infoexA.szModName ); "GetIconInfoEx wrong module %s\n", infoexA.szModName );
ok( infoexA.szResName[0] == 0, "GetIconInfoEx wrong name %s\n", infoexA.szResName ); ok( infoexA.szResName[0] == 0, "GetIconInfoEx wrong name %s\n", infoexA.szResName );
infoexW.cbSize = sizeof(infoexW); infoexW.cbSize = sizeof(infoexW);
ret = pGetIconInfoExW( handle, &infoexW ); ret = pGetIconInfoExW( handle, &infoexW );
ok( ret, "GetIconInfoEx failed err %d\n", GetLastError() ); ok( ret, "GetIconInfoEx failed err %d\n", GetLastError() );
todo_wine ok( infoexW.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexW.wResID ); ok( infoexW.wResID == (UINT_PTR)IDI_HAND, "GetIconInfoEx wrong resid %x\n", infoexW.wResID );
todo_wine ok( GetModuleHandleW(infoexW.szModName) == GetModuleHandleA("user32.dll"), ok( GetModuleHandleW(infoexW.szModName) == GetModuleHandleA("user32.dll"),
"GetIconInfoEx wrong module %s\n", wine_dbgstr_w(infoexW.szModName) ); "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) ); ok( infoexW.szResName[0] == 0, "GetIconInfoEx wrong name %s\n", wine_dbgstr_w(infoexW.szResName) );
} }
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);