diff --git a/win32ss/user/user32/windows/cursoricon.c b/win32ss/user/user32/windows/cursoricon.c index 586deb7a728..53c98456e81 100644 --- a/win32ss/user/user32/windows/cursoricon.c +++ b/win32ss/user/user32/windows/cursoricon.c @@ -2044,7 +2044,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 the original bit map if we need + * 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;