user32: Fixed bug in loading .cur files (try 2)

JIM CAMERON jim_24601 at
Wed Aug 27 15:58:24 CDT 2008

The existing code to load a cursor from an icon file
slurps the file into memory and calls
CreateIconFromResourceEx() to create the cursor
proper. However, CreateIconFromResourceEx() expects
the hotspot to immediately precede the bitmap
definition in memory when called to create a cursor,
which is not the case in an icon file, since the
hotspot already exists in the icon info. This causes
the process to fail.

The attached patch extracts the guts from
CreateIconFromResourceEx() into a separate function
taking a bitmap and a hotspot, and makes
CreateIconFromResourceEx() and
CURSORICON_LoadFromFile() call it after extracting the
hotspot. It also removes some todo from the
corresponding test file, since the fix causes some
tests to unexpectedly succeed (thanks Paul Vriens for
pointing that out).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fixed-bug-in-loading-.cur-files.patch
Type: text/x-diff
Size: 0 bytes
Desc: 889986991-0002-Fixed-bug-in-loading-.cur-files.patch
Url : 

More information about the wine-patches mailing list