<div dir="ltr">Hi,<div><br></div><div>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.</div><div><br></div><div>Afaik reusing the same context in different threads is considered bad practice (<a href="http://muscle.musclecard.narkive.com/ZAn5vTFD/multiple-threads-and-scardgetstatuschange">http://muscle.musclecard.narkive.com/ZAn5vTFD/multiple-threads-and-scardgetstatuschange</a>)?</div><div><br></div><div>Regards, Michael</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 12:12 PM, Ludovic Rousseau <span dir="ltr"><<a href="mailto:ludovic.rousseau@gmail.com" target="_blank">ludovic.rousseau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-10-17 19:26 GMT+02:00 Maksim Ivanov <span dir="ltr"><<a href="mailto:emaxx@google.com" target="_blank">emaxx@google.com</a>></span>:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Hello,<br></blockquote><div><br></div><div>Hello Maksim,<br> <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<br>
It seems that there's a difference between the PC/SC-Lite behavior and<br>
the behavior of the Windows' implementation in the following scenario:<br>
<br>
1. One thread obtains an hCard with SCARD_SHARE_SHARED.<br>
<br>
2. This thread calls then SCardBeginTransaction with this hCard.<br>
<br>
3. Another thread in the same application tries to obtain a new hCard<br>
to the same card with SCARD_SHARE_SHARED.<br>
<br>
Under Windows step #3 finishes successfully.<br>
PC/SC-Lite, however, seems to block all new connections to the card<br>
(even in the shared mode) until the previously started transaction<br>
finishes.<br>
<br>
Not sure whether this can be considered as a bug. It seems that there<br>
are no guarantees about this use case in the PC/SC specification.<br></blockquote><div><br></div><div>I could change pcsc-lite code to be more like Windows but:<br></div><div>- nobody complained about this<br></div><div>- it could has bad side effects if not done right<br></div><div>- it would take time to code and test<br></div><div> <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<br>
But even if this is not considered as a bug by the maintainers, it<br>
would be good to cover this detail in the corresponding "Known<br>
differences" list:<br>
<a rel="noreferrer" href="http://pcsclite.alioth.debian.org/api/group__API.html#differences" target="_blank">http://pcsclite.alioth.debian.<wbr>org/api/group__API.html#differ<wbr>ences</a><br>
<br></blockquote><div><br></div><div>Good suggestion.<br></div><div>Fixed in <a href="https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=pcsclite/PCSC.git;a=commitdiff;h=aa9db5f12b892c94585452fc106d48f064bc0f60;hp=45dd695d05742b039384951e130570aed289d7ca" target="_blank">https://alioth.debian.org/<wbr>plugins/scmgit/cgi-bin/gitweb.<wbr>cgi?p=pcsclite/PCSC.git;a=<wbr>commitdiff;h=<wbr>aa9db5f12b892c94585452fc106d48<wbr>f064bc0f60;hp=<wbr>45dd695d05742b039384951e130570<wbr>aed289d7ca</a><br><br></div><div>Thanks<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div></div><span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_-5934667346678871021gmail_signature"> Dr. Ludovic Rousseau</div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Pcsclite-muscle mailing list<br>
<a href="mailto:Pcsclite-muscle@lists.alioth.debian.org">Pcsclite-muscle@lists.alioth.<wbr>debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle" rel="noreferrer" target="_blank">http://lists.alioth.debian.<wbr>org/cgi-bin/mailman/listinfo/<wbr>pcsclite-muscle</a><br></blockquote></div><br></div>