https://bugs.winehq.org/show_bug.cgi?id=54661
Bug ID: 54661 Summary: winscard:winscard - The 32-bit test crashes in Wine due to incorrect libpcsclite function signatures Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: winscard Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
winscard:winscard - The 32-bit test crashes in Wine due to incorrect libpcsclite function signatures:
winscard.c:49: Test failed: got 80100004 winscard.c:52: Test failed: got 6 winscard.c:61: Test failed: got 6 [...] winscard.c:120: Test failed: got deadbeef Unhandled exception: page fault on read access to 0xdeadbeef in 32-bit code (0x6d702b0e).
See https://test.winehq.org/data/patterns.html#winscard:winscard
Where 0x80100004 == SCARD_E_INVALID_PARAMETER
The only important failure is the first one: SCARD_E_INVALID_PARAMETER. This happens because Wine's winscard implementation passes NULL context pointer to the libpcsclite SCardEstablishContext() function. And this happens because that function takes a 32-bit scope value while unixlib.c declares that parameter are 64-bit so the remaining parameters are all shifted.
That makes the commit below the source of the bug:
commit 8490c43f38e306fef7b5fed3ffcb256efd73af58 Author: Hans Leidekker hans@codeweavers.com AuthorDate: Thu Feb 16 09:56:12 2023 +0100
winscard: Implement SCardEstablish/ReleaseContext() on top of libpcsclite.