Module: wine Branch: master Commit: 0f511f3c8e3105b00953648a8a072bfaada94ea3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0f511f3c8e3105b00953648a8a...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Dec 22 17:13:49 2009 +0100
user32: Don't assume global handles in CopyIcon.
---
dlls/user32/cursoricon.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 90f8356..2b2151a 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1451,11 +1451,12 @@ HICON WINAPI CopyIcon( HICON hIcon ) { CURSORICONINFO *ptrOld, *ptrNew; int size; - HICON16 hOld = HICON_16(hIcon); HICON hNew;
if (!(ptrOld = wow_handlers.get_icon_ptr( hIcon ))) return 0; - size = GlobalSize16( hOld ); + size = sizeof(CURSORICONINFO); + size += ptrOld->nHeight * get_bitmap_width_bytes( ptrOld->nWidth, 1 ); /* and bitmap */ + size += ptrOld->nHeight * ptrOld->nWidthBytes; /* xor bitmap */ hNew = wow_handlers.alloc_icon_handle( size ); ptrNew = wow_handlers.get_icon_ptr( hNew ); memcpy( ptrNew, ptrOld, size );