For those developping/debugging on Windows I may have something interesting for you.
To debug my programs, I needed to capture APDU. I was getting tired of making winscard.dll stubs for x64 & x86 and for each Windows version. Typically new minidriver (like GIDS) are using SCardReadCache / WriteCache functions which are not available on older version.
Re: Capturing APDU trace on Windows => my solution
>The adaptation needed for a winscard.dll stub for all version of Windows is
>a continous job.
>Like for the function SCardReadCache used by the PIV/GIDS minidriver,
>that's why I explored an other lead ...
>I do not know if there is a problem in winscard stub, but the Base smart
>card KSP on Windows 10 seems to prohibit the use of winscard stub.
Another interesting approach is to inject a dll which hooks winscard API into a running process. I had some working PoC code (which I -unfortunately- can not share).