This framework is present in all macOS SDKs we support, starting at macOS 10.13 and still present in macOS Sonoma.
Getting pcsclite completely working correctly is a lot harder on macOS and this would give us better integration.
From: Gijs Vermeulen gijsvrm@gmail.com
--- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac index b32d2ba5aa4..11b9a794a99 100644 --- a/configure.ac +++ b/configure.ac @@ -403,6 +403,7 @@ AC_CHECK_HEADERS(\ CL/cl.h \ EGL/egl.h \ OpenCL/opencl.h \ + PCSC/pcsclite.h \ arpa/inet.h \ arpa/nameser.h \ asm/types.h \ @@ -1391,7 +1392,13 @@ WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_init" != xyes], dnl **** Check for libpcsclite **** if test "x$with_pcsclite" != "xno" then - AC_CHECK_LIB(pcsclite,SCardEstablishContext,[AC_SUBST(PCSCLITE_LIBS,["-lpcsclite"])]) + if test "$ac_cv_header_PCSC_pcsclite_h" = "yes" + then + AC_SUBST(PCSCLITE_LIBS,"-framework PCSC") + ac_cv_lib_pcsclite_SCardEstablishContext=yes + else + AC_CHECK_LIB(pcsclite,SCardEstablishContext,[AC_SUBST(PCSCLITE_LIBS,["-lpcsclite"])]) + fi fi WINE_NOTICE_WITH(pcsclite,[test "x$ac_cv_lib_pcsclite_SCardEstablishContext" != xyes], [libpcsclite not found, smart cards won't be supported.],
It would be nice if can we use the PCSC framework even though it has been deprecated for a while now. I'm not sure it will work with the current state of winscard, I'll see if I can run some tests.
On Mon Jul 24 11:13:09 2023 +0000, Hans Leidekker wrote:
It would be nice if can we use the PCSC framework even though it has been deprecated for a while now. I'm not sure it will work with the current state of winscard, I'll see if I can run some tests.
I did run the tests and got 7 failures. The most important one is an access violation in SCardGetStatusChangeA.
I'll try and post more detailed results later today.
On Mon Jul 24 11:13:19 2023 +0000, Gijs Vermeulen wrote:
I did run the tests and got 7 failures. The most important one is an access violation in SCardGetStatusChangeA. I'll try and post more detailed results later today.
[winscard_tests.txt](/uploads/923226e7adbc30044dd8f4473ca6dbfe/winscard_tests.txt)
Attached is a log from running the tests with a reader attached.
[winscard.diff](/uploads/f2f688572b2d290953628277e4397bc1/winscard.diff)
Here's a patch that accounts for the DWORD mismatch. Does it work for you? The SCardGetStatusChange() tests still fail and that's because this function is simply broken on macOS. It doesn't support the special reader name "\\?PnP?\Notification" and crashes when this name is in a list with other readers.
The PCSC framework is an old fork of PCSC lite and its author has submitted bug reports and feature requests but Apple made it clear that it's no longer developing this interface. (see https://ludovicrousseau.blogspot.com/2015/12/os-x-el-capitan-bug-scardgetsta...)
The other tests pass including sending commands to the card so it still seems useful to have this in Wine. If an app needs working SCardGetStatusChange() then that can probably be solved by switching to a current PCSC lite build.
On Tue Jul 25 14:02:09 2023 +0000, Hans Leidekker wrote:
[winscard.diff](/uploads/f2f688572b2d290953628277e4397bc1/winscard.diff) Here's a patch that accounts for the DWORD mismatch. Does it work for you? The SCardGetStatusChange() tests still fail and that's because this function is simply broken on macOS. It doesn't support the special reader name "\\?PnP?\Notification" and crashes when this name is in a list with other readers. The PCSC framework is an old fork of PCSC lite and its author has submitted bug reports and feature requests but Apple made it clear that it's no longer developing this interface. (see https://ludovicrousseau.blogspot.com/2015/12/os-x-el-capitan-bug-scardgetsta...) The other tests pass including sending commands to the card so it still seems useful to have this in Wine. If an app needs working SCardGetStatusChange() then that can probably be solved by switching to a current PCSC lite build.
@hans Although the test results seem to be the same with your patch (7 failures), my test app now works and I can read/process the info from my card, thanks!
On Tue Jul 25 14:06:58 2023 +0000, Gijs Vermeulen wrote:
@hans Although the test results seem to be the same with your patch (7 failures), my test app now works and I can read/process the info from my card, thanks! EDIT: Hotplugging doesn't work, I guess that might be related to the SCardGetStatusChange problem you mentioned?
Right, hotplugging requires support for "\\?PnP?\Notification" in SCardGetStatusChange().
Hans Leidekker (@hans) commented about configure.ac:
dnl **** Check for libpcsclite **** if test "x$with_pcsclite" != "xno" then
- AC_CHECK_LIB(pcsclite,SCardEstablishContext,[AC_SUBST(PCSCLITE_LIBS,["-lpcsclite"])])
- if test "$ac_cv_header_PCSC_pcsclite_h" = "yes"
- then
AC_SUBST(PCSCLITE_LIBS,"-framework PCSC")
ac_cv_lib_pcsclite_SCardEstablishContext=yes
- else
AC_CHECK_LIB(pcsclite,SCardEstablishContext,[AC_SUBST(PCSCLITE_LIBS,["-lpcsclite"])])
- fi
pcsclite has more features than the native framework so it would be better to change the order.