[Pcsclite-muscle] sample code

Ludovic Rousseau ludovic.rousseau at gmail.com
Sat Apr 8 06:54:19 PDT 2023


Le ven. 7 avr. 2023 à 22:40, Ludovic Rousseau
<ludovic.rousseau at gmail.com> a écrit :
>
> Le ven. 7 avr. 2023 à 17:36, Allen Curtis
> <allen at criticalsoftwaresolutions.com> a écrit :
> >
> > Below is the attached code distilled down to the relevant logic. The
> > actual source files are attached as well for your review.
>
> Please provide a MINIMAL sample code. And a program that can run with
> any reader name.

It looks like a bug on your code.
>From SCardEstablishContext() documentation
https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67
" This must be the first WinSCard function called in a PC/SC
application. Each thread of an application shall use its own
SCARDCONTEXT, unless calling SCardCancel(), which MUST be called with
the same context as the context used to call SCardGetStatusChange(). "

>From your source code I see you use 2 threads but only one
SCardEstablishContext() call.
Fix your code and try again.

Bye

-- 
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list