You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Byte extraction followed by combining the results leads to incorrect C as "byte" casting is missing (effectively ignoring the 2 MOV ?H, 0 instructions), see example:
The Windows docs give the following code excerpt as their extraction mechanism:
len = sprintf(sxBuf, "Windows Version %d.%d\n", LOBYTE(LOWORD(dwVersion)), HIBYTE(LOWORD(dwVersion)));
sprintf(szBuf + len, "Dos Version %d.%d\n", HIBYTE(HIWORD(dwVersion)), LOBYTE(HIWORD(dwVersion)));
so g_nWinVer_135a = (uint)dwVersion >> 8 | (uint)dwVersion << 8;
should be equivalent to g_nWinVer_135a = (HIBYTE(LOWORD(dwVersion)) >> 8) | (LOBYTE(LOWORD(dwVersion)) << 8);
but the LOBYTE(LOWORD(dwVersion)) drops the hi byte whereas (uint)dwVersion << 8 retains it.
To Reproduce
Steps to reproduce the behavior:
Load in the enclosed function (from the Decompile:Panels Debug Function Decompilation menu)
Describe the bug
Byte extraction followed by combining the results leads to incorrect
C
as "byte" casting is missing (effectively ignoring the 2MOV ?H, 0
instructions), see example:produces
The Windows docs give the following code excerpt as their extraction mechanism:
so
g_nWinVer_135a = (uint)dwVersion >> 8 | (uint)dwVersion << 8;
should be equivalent to
g_nWinVer_135a = (HIBYTE(LOWORD(dwVersion)) >> 8) | (LOBYTE(LOWORD(dwVersion)) << 8);
but the
LOBYTE(LOWORD(dwVersion))
drops the hi byte whereas(uint)dwVersion << 8
retains it.To Reproduce
Steps to reproduce the behavior:
Decompile:
PanelsDebug Function Decompilation
menu)Expected behavior
Correct
C
produced.Screenshots
N/A
Attachments
dragmedi_isWin3.zip
Environment (please complete the following information): - OS: Windows 11
Additional context
N/A
The text was updated successfully, but these errors were encountered: