[Pcsclite-muscle] Difference from Windows' implementation with regard to PC/SC shared mode

Michael Traut michael.traut at gmail.com
Wed Oct 26 10:32:53 UTC 2016


Hi,

i can not unconditionally confirm this behavior under windows. At least
when using different contexts, the second connect is blocked, even when it
is shared. I have no example when the same context is used, this may differ.

Afaik reusing the same context in different threads is considered bad
practice (
http://muscle.musclecard.narkive.com/ZAn5vTFD/multiple-threads-and-scardgetstatuschange
)?

Regards, Michael

On Wed, Oct 26, 2016 at 12:12 PM, Ludovic Rousseau <
ludovic.rousseau at gmail.com> wrote:

> 2016-10-17 19:26 GMT+02:00 Maksim Ivanov <emaxx at google.com>:
>
>> Hello,
>>
>
> Hello Maksim,
>
>
>>
>> It seems that there's a difference between the PC/SC-Lite behavior and
>> the behavior of the Windows' implementation in the following scenario:
>>
>> 1. One thread obtains an hCard with SCARD_SHARE_SHARED.
>>
>> 2. This thread calls then SCardBeginTransaction with this hCard.
>>
>> 3. Another thread in the same application tries to obtain a new hCard
>> to the same card with SCARD_SHARE_SHARED.
>>
>> Under Windows step #3 finishes successfully.
>> PC/SC-Lite, however, seems to block all new connections to the card
>> (even in the shared mode) until the previously started transaction
>> finishes.
>>
>> Not sure whether this can be considered as a bug. It seems that there
>> are no guarantees about this use case in the PC/SC specification.
>>
>
> I could change pcsc-lite code to be more like Windows but:
> - nobody complained about this
> - it could has bad side effects if not done right
> - it would take time to code and test
>
>
>>
>> But even if this is not considered as a bug by the maintainers, it
>> would be good to cover this detail in the corresponding "Known
>> differences" list:
>> http://pcsclite.alioth.debian.org/api/group__API.html#differences
>>
>>
> Good suggestion.
> Fixed in https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.
> cgi?p=pcsclite/PCSC.git;a=commitdiff;h=aa9db5f12b892c94585452fc106d48
> f064bc0f60;hp=45dd695d05742b039384951e130570aed289d7ca
>
> Thanks
>
> --
>  Dr. Ludovic Rousseau
>
> _______________________________________________
> Pcsclite-muscle mailing list
> Pcsclite-muscle at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20161026/a6d8ca7c/attachment.html>


More information about the Pcsclite-muscle mailing list