Skip to content

Commit

Permalink
[USER32] Hackfix for CORE-17902 - The cursoricon (copyimage) that ret…
Browse files Browse the repository at this point in the history
…urns NULL to render - LR_COPYFROMRESOURCE

[USER32] Fix the previous commit based on the suggested comments

[USER32] Minor fixes and fixing identation
  • Loading branch information
julenuri committed May 21, 2024
1 parent 1a16237 commit e30a5e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion win32ss/user/user32/windows/cursoricon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,15 @@ HANDLE WINAPI CopyImage(
return BITMAP_CopyImage(hImage, cxDesired, cyDesired, fuFlags);
case IMAGE_CURSOR:
case IMAGE_ICON:
return CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, fuFlags);
/* HACK: Copying bitmaps with LR_COPYFROMRESOURCE flag fails. CORE-17902.
* This is a way to return original bit map it if we want
* the icons to show up. We need a simpler test. */
{
HANDLE handle = CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, fuFlags);
if (!handle && (fuFlags & (LR_COPYFROMRESOURCE|LR_COPYRETURNORG)))
handle = CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, (fuFlags & ~LR_COPYFROMRESOURCE));
return handle;
}
default:
SetLastError(ERROR_INVALID_PARAMETER);
break;
Expand Down

0 comments on commit e30a5e5

Please sign in to comment.