https://bugs.winehq.org/show_bug.cgi?id=46256
Bug ID: 46256 Summary: EndUpdateResourceW should set errno on invalid handle Product: Wine Version: 3.17 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: stu.axon@gmail.com Distribution: ---
EndUpdateResourceW -- will return False if the handle is invalid but will not set a proper errorno(https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/resource.c#L17...)
This bug was originally reported in pywin32-ctypes https://github.com/enthought/pywin32-ctypes/issues/59
http://bugs.winehq.org/show_bug.cgi?id=46256
--- Comment #1 from Janne janne.kekkonen@gmail.com --- Created attachment 79057 --> http://bugs.winehq.org/attachment.cgi?id=79057 test application source
Created very simple test application for EndUpdateResourceW. Most likely it will not cover all possible invalid handle possibilities.
Compiled application with following parameters: x86_64-w64-mingw32-gcc -Wall -g3 endupdate.c -static -lkernel32 -o endupdate_64.exe
Wine was patched with patches on bug-46255.
Result on Windows 11: C:\temp>ver
Microsoft Windows [Version 10.0.26100.4652]
C:\temp>endupdate_64.exe Ret val:0 LastError:87 Ret val:1 LastError:0
C:\temp>
Result on Wine:
WINEPREFIX=~/wine64 WINEARCH=win64 ~/wine64/wine --version
wine-10.12-91-ge44737278a4
WINEPREFIX=~/wine64 WINEARCH=win64 ~/wine64/wine cmd.exe
Microsoft Windows 10.0.19045
C:\temp>endupdate_64.exe Ret val:0 LastError:6 Ret val:0 LastError:6
C:\temp>
Test application source attached.
http://bugs.winehq.org/show_bug.cgi?id=46256
Janne janne.kekkonen@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |janne.kekkonen@gmail.com
--- Comment #2 from Janne janne.kekkonen@gmail.com --- Applied Test3 patch from bug-46255 to Wine.
With these changes test application output this:
WINEPREFIX=~/wine64 WINEARCH=win64 ~/wine64/wine --version
wine-10.12-225-g00f6c0460b6
WINEPREFIX=~/wine64 WINEARCH=win64 ~/wine64/wine cmd.exe
Microsoft Windows 10.0.19045
C:\temp>endupdate_64.exe Ret val:0 LastError:87 Ret val:1 LastError:6
C:\temp>