[Pcsclite-muscle] ScardConnect SCARD_SHARE_DIRECT

Ludovic Rousseau ludovic.rousseau
Wed Sep 28 00:58:55 PDT 2016


2016-09-27 23:50 GMT+02:00 Christophe FERRANDO <
christophe.ferrando at sylyca.com>:

> Hello,
>

Hello Christophe,


>
>
>
> I am working on some tests for my product.
>
>
>
> On of the test says :
>
>
>
> Insert a card who does not support RAW PROTOCOL (A french health card :
> Vitale) : OK
>
>
>
> First, call :
>
> rv = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);
>
> OK
>
>
>
> Second, the return should be SCARD_E_NOT_READY
>
> rv = SCardConnect(hContext,mszReaders,SCARD_SHARE_DIRECT,
>
>                                                                -1,
> &hCard, &dwActiveProtocol);
>
>
>
> The result is every time SUCCESS, even with no card, with RAW_PROTOCOL
> instead of -1, ?
>
>
>
> I don?t think i can have an error with this test ?
>
>
>
> Any idea, how can i have the return SCARD_E_NOT_READY, which is present in
> the documentation of SCARD_CONNECT.
>
>
SCARD_E_NOT_READY is not used by any pcsc-lite function.

SCARD_SHARE_DIRECT (on pcsc-lite) is used to talk to the reader, not to the
card. So it is normal that you do not get an error if the card is not
present or not responding.

The pcsc-lite API for SCardConnect() is at:
https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5

A list of (major) differences between Windows PC/SC and pcsc-lite is
available at
https://pcsclite.alioth.debian.org/api/group__API.html#differences

Bye

-- 
 Dr. Ludovic Rousseau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20160928/072251f4/attachment.html>



More information about the pcsclite-muscle mailing list