[Pcsclite-muscle] Asynchronous PCSC API
Stephan Brunner
s.brunner at stephan-brunner.net
Sun Jan 30 05:06:47 PST 2022
Am Sunday, dem 30.01.2022 um 13:49 +0100 schrieb Ludovic Rousseau:
> Le sam. 29 janv. 2022 à 21:29, Stephan Brunner
> <s.brunner at stephan-brunner.net> a écrit :
> >
> > Hi,
>
> Hello Stephan,
Hello Ludovic,
>
> > I'm not very sure about that one as I haven't done anything recent
> > with
> > PCSC on Windows, but I think SCardCancel has to be issued on the
> > same
> > handle as the request, thus doing it in the same process on
> > different
> > threads. And not on a different process or with a different handle.
>
> This is exactly what cardlock_cancel.c is doing.
> https://github.com/eugmes/cardlock/blob/master/cardlock_cancel.c#L92
Thanks! Didn't notice that.
>
> Ievgenii published the complete project at
> https://github.com/eugmes/cardlock
> The samples should work on GNU/Linux, Windows and macOS.
>
> > Otherwise I'd imagine the second context won't get a lock on the
> > reader
> > or something like that.
>
> The other process cardlock.c is (just) used to start a PC/SC
> transaction and lock the access to the card.
> https://github.com/eugmes/cardlock/blob/master/cardlock.c
>
> If someone can run the sample codes on Windows and get a working
> SCardCancel() that would help.
I did run the samples from Ievgenii:
First window:
$ cardlock.exe "Generic EMV Smartcard Reader 0"
connecting...
beginning transaction...
status check
status check
status check
status check
[...]
Second window:
$ cardlock_cancel.exe "Generic EMV Smartcard Reader 0"
connecting...
cancelling
C:\Users\s.brunner\source\repos\cardlock\cardlock_cancel.c:32 -
80100002
done
First window, without doing anything:
[...]
status check
status check
The SCardCancel of _cancel.exe works for me without me having to
interrupt the cardlock.exe or doing something else.
I'm using a cheap No-Name EMV Reader from Amazon:
XYSTEC PX-8935-675
USB Description: Alcor Micro Corp. AU9540 Smartcard Reader
USB VID:PID 058f:9540
I'm running Windows 10 21H2 Build 19043.1466.
Inserted into the reader is a ZeitControl OpenPGP Card v3.3.
>
> Bye
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5612 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/pcsclite-muscle/attachments/20220130/b880cec6/attachment.p7s>
More information about the pcsclite-muscle
mailing list