Alexandre Julliard : user.exe: Always pass a resource size to CreateIconFromResourceEx16.
Alexandre Julliard
julliard at winehq.org
Mon Jun 17 14:07:47 CDT 2013
Module: wine
Branch: master
Commit: 4894711768695e19a9f1f0b29efeb99574314e32
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4894711768695e19a9f1f0b29efeb99574314e32
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jun 17 11:14:20 2013 +0200
user.exe: Always pass a resource size to CreateIconFromResourceEx16.
---
dlls/user.exe16/user.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c
index b99c0ad..9500f59 100644
--- a/dlls/user.exe16/user.c
+++ b/dlls/user.exe16/user.c
@@ -2094,6 +2094,7 @@ HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 c
{
HGLOBAL16 handle;
HRSRC16 hRsrc, hGroupRsrc;
+ DWORD size;
if (!hinst || (flags & LR_LOADFROMFILE))
{
@@ -2129,7 +2130,6 @@ HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 c
BITMAPFILEHEADER header;
WCHAR path[MAX_PATH], filename[MAX_PATH];
HANDLE file;
- DWORD size;
filename[0] = 0;
if (!(hRsrc = FindResource16( hinst, name, (LPCSTR)RT_BITMAP ))) return 0;
@@ -2186,7 +2186,8 @@ HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 c
if (!(handle = LoadResource16( hinst, hRsrc ))) return 0;
bits = LockResource16( handle );
- hIcon = CreateIconFromResourceEx16( bits, 0, type == IMAGE_ICON, 0x00030000, cx, cy, flags );
+ size = SizeofResource16( hinst, hRsrc );
+ hIcon = CreateIconFromResourceEx16( bits, size, type == IMAGE_ICON, 0x00030000, cx, cy, flags );
FreeResource16( handle );
if (hIcon && (flags & LR_SHARED)) add_shared_icon( hinst, hRsrc, hGroupRsrc, hIcon );
@@ -2734,7 +2735,7 @@ WORD WINAPI GetIconID16( HGLOBAL16 hResource, DWORD resType )
*/
HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew )
{
- return CreateIconFromResourceEx16( LockResource16( hResource ), 0, TRUE,
+ return CreateIconFromResourceEx16( LockResource16( hResource ), 0xffff, TRUE,
bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR );
}
More information about the wine-cvs
mailing list