-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[USER32] Hackfix for CORE-17902 - The cursoricon (copyimage) that returns NULL to render - LR_COPYFROMRESOURCE #6886
base: master
Are you sure you want to change the base?
Conversation
switch(uType) | ||
{ | ||
case IMAGE_BITMAP: | ||
return BITMAP_CopyImage(hImage, cxDesired, cyDesired, fuFlags); | ||
case IMAGE_CURSOR: | ||
case IMAGE_ICON: | ||
return CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, fuFlags); | ||
handle = CURSORICON_CopyImage(hImage, uType == IMAGE_ICON, cxDesired, cyDesired, fuFlags); | ||
if(handle == NULL && (fuFlags & (LR_COPYFROMRESOURCE|LR_COPYRETURNORG))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you run the VB-based app in ReactOS, which flag(s) amongst these two are being specified? Both? or only one of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition I would suggest you add here in the code a // HACK
or // HACKFIX
comment explaining what's happening, with the CORE-xxxx number mentioned too.
I also wonder whether this hack could be added instead into the CURSORICON_CopyImage
function instead? In any case I guess running the test bots on that would be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are being specified according to the ticket info. LR_COPYFROMRESOURCE and LB_COPYRETURNORG.
Not sure about the second comment.
I do know that under Wine, it always show up the icons, but not sure how they do. And not 100% sure how Windows does at all. So if anyone can bring light, better than better.
I think I can't execute the test bot by myself, I have no rights for that I guess.
@@ -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: Returning the old bitmap in LR_COPYFROMRESOURCE caused |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* HACK: Returning the old bitmap in LR_COPYFROMRESOURCE caused | |
// HACK: Copying bitmaps with LR_COPYFROMRESOURCE flag fails. CORE-17902. |
…urns NULL to render - LR_COPYFROMRESOURCE [USER32] Fix the previous commit based on the suggested comments [USER32] Minor fixes and fixing identation
c526c7a
to
e30a5e5
Compare
Testbot Results: KVM: https://reactos.org/testman/compare.php?ids=95854,95861 LGTM |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
* This is a way to return the original bit map if we need
I was able to test this and the icons show up after making these changes. |
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Hackfix for CORE-17902 - The cursoricon (copyimage) that returns NULL to render - LR_COPYFROMRESOURCE
Purpose
In this case, the aim is to render some VB5/6 software icons to show up. Those elements are icons rendered in a way that is common under Visual Basic icons loaded from a .ocx .
ThunderRT6FormDC->ThunderRT6UserControlDC->RebarWindows32->Toolbar20WndClass->msvb_lib_toolbar
Quoting Simone:
More info here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-copyimage
Proposed changes
Minor (fix? or hackfix?) that should make it to work.
BEFORE:
AFTER:
TODO