Skip to content
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

Error when displaying images, LoadImage16 #1380

Open
chross opened this issue Feb 22, 2024 · 11 comments
Open

Error when displaying images, LoadImage16 #1380

chross opened this issue Feb 22, 2024 · 11 comments

Comments

@chross
Copy link

chross commented Feb 22, 2024

Describe the bug
The software I'm running (genetics pedigree program Cyrillic2) will display images, but upon clicking on the user interface, all images will become blank. Upon clicking on individual images, the LoadImage16 error messages will appear (see log below) and each individual image will be displayed.

5c38:err:winevdm:set_peb_compatible_flag user32.dll has already been loaded. (Anti-virus software may be the cause.)
5c38:err:winevdm:set_peb_compatible_flag Some compatibility flags can not be applied.
version: 2494
5c38:err:winevdm:main Spawn a child process to apply compatible flags.
5c38:err:winevdm:fix_compatible child pid = 22868
45a8:err:winevdm:set_peb_compatible_flag user32.dll has already been loaded. (Anti-virus software may be the cause.)
45a8:err:winevdm:set_peb_compatible_flag Some compatibility flags can not be applied.
version: 2494
45a8:err:winevdm:main parent pid = 13704
1408:err:user:LoadImage16 LoadImageA(0, 12454, 2, 0, 0, 32832)
1408:err:user:LoadImage16 LoadImageA(0, 12454, 2, 0, 0, 32832)
1408:err:user:LoadImage16 LoadImageA(0, 12454, 2, 0, 0, 32832)
1408:err:user:LoadImage16 LoadImageA(0, 12454, 2, 0, 0, 32832)
1408:err:user:LoadImage16 LoadImageA(0, 12454, 2, 0, 0, 32832)

Expected behavior
Display images correctly.

Screenshots
cyrerr
cyrerr_ok

Environment (please complete the following information):

  • OS: Windows 10 Education 19042.2965
  • Version: 2494

Additional context
I did not install otvdm as I am running a single exe file. I start the software with otvdm cyrillic.exe from a batch file.
I have already applied a variety of settings in otvdm.ini, to no avail.

Trace
Note: trace is redacted for personal information
trace.txt

@cracyc
Copy link
Contributor

cracyc commented Feb 23, 2024

I found a demo of this at https://www.apbenson.com/cyrillic-downloads but I can't reliably repo this problem. It doesn't happen at all when I load the examples and happened only once when creating a new file. I do get the loadimage error but I think it's unrealated. I could be missing something because I don't know how to use this program. I do get a crash at exit every time though.

@chross
Copy link
Author

chross commented Mar 4, 2024

I'm getting the crash, too, however only when using the demo version.
In the regular software, especially when resizing the window to full screen, the icons will disappear.

cracyc I've shared a repo with you, please have a look.

@cracyc
Copy link
Contributor

cracyc commented Mar 5, 2024

So far I've found that they disappear if the window is larger than about 2075px width or 915px height. It's likely a bug in the program as very few win16 developers expected to support displays that large. The demo version has the width program but not the height oddly. Print preview doesn't show the icons in either version no matter the size and although printing works (as long as you don't use the adjustdpi option).

@chross
Copy link
Author

chross commented Mar 5, 2024

The bug triggers as well when having the window resized to smaller dimensions by using the zoom function.
When using this software in a VM on XP I never get those bugs.

@cracyc
Copy link
Contributor

cracyc commented Mar 5, 2024

It also works in winevdm without the issues in an xp vm but the bug is still in the program itself. Specifially, it uses MM_TWIPS which on large resolution and physical displays can overflow (the vm reports a smaller physical display size which is why it works there.

@chross
Copy link
Author

chross commented Mar 11, 2024

Sadly, the new gdi.exe didn't help and the problem prevails.
What could be done to make the program run smoothly? Could it somehow be patched?

@cracyc
Copy link
Contributor

cracyc commented Mar 13, 2024

By the way, i see from the trace that you have a 1920x1080 display but how large is it?

@chross
Copy link
Author

chross commented Mar 15, 2024

This gdi.exe does still not work. Even if I leave the program window at a normal size (not maximized), when zooming inside the program, the images will disappear at certain zoom levels (too large but also too small).

My PC has three screens attached:
1: middle 19201080 - 100% scaling
2: right 1920
1080 - 100% scaling
3: left 1080*1920 - 100% scaling (numbers inverted as it set up vertically)

@cracyc
Copy link
Contributor

cracyc commented Mar 21, 2024

I found a fix that works for me that is safer. You can get it to try from https://ci.appveyor.com/project/otya128/winevdm/builds/49450326/job/mqtgdyr60425wo00/artifacts .

@chross
Copy link
Author

chross commented Mar 21, 2024

Wow! It seems to work flawlessly. How did you do that? What was the reason for this bug, do you care to expain it in a bit more detail?

Thanks anyway. I am very happy and will be testing this build thoroughly.

@cracyc
Copy link
Contributor

cracyc commented Mar 21, 2024

Well, it uses windows coordinate transformations, https://learn.microsoft.com/en-us/windows/win32/gdi/coordinate-spaces-and-transformations, to simplify zooming but in some cases, mostly with larger physical displays, the output overflows a 16bit int as win32 uses 32bits for the coordinates. In the other gdi.dlls I tried changing the mapping mode to reduce the size of the multiplier but the last change just clamps the output to [-32768, 32767].

otya128 added a commit that referenced this issue Mar 27, 2024
clamp world transform coordinates to 16 bits.
#1380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants