Skip to content

Commit

Permalink
[USER32] Fix the previous commit based on the suggested comments
Browse files Browse the repository at this point in the history
  • Loading branch information
julenuri committed May 16, 2024
1 parent e1b1dbe commit 27df753
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions win32ss/user/user32/windows/cursoricon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,17 +2025,21 @@ HANDLE WINAPI CopyImage(
{
TRACE("hImage=%p, uType=%u, cxDesired=%d, cyDesired=%d, fuFlags=%x\n",
hImage, uType, cxDesired, cyDesired, fuFlags);
HANDLE handle;
switch(uType)
{
case IMAGE_BITMAP:
return BITMAP_CopyImage(hImage, cxDesired, cyDesired, fuFlags);
case IMAGE_CURSOR:
case IMAGE_ICON:
handle = CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, fuFlags);
if(handle == NULL && (fuFlags & (LR_COPYFROMRESOURCE|LR_COPYRETURNORG)))
/* HACK: Returning the old bitmap in LR_COPYFROMRESOURCE caused
* failure, so this is a way to return original bit map it if we want
* the icons to show up. Look at CORE-17902. 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 27df753

Please sign in to comment.