ScardConnect SCARD_SHARE_DIRECT

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ScardConnect SCARD_SHARE_DIRECT

Christophe FERRANDO

Hello,

 

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.

 

Sincerly,

 

Christophe FERRANDO

 

 

 


_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: ScardConnect SCARD_SHARE_DIRECT

Ludovic Rousseau
2016-09-27 23:50 GMT+02:00 Christophe FERRANDO <[hidden email]>:

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

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: ScardConnect SCARD_SHARE_DIRECT

Christophe FERRANDO

Thanks,

I understand now,

Have a nice day,

 

Christophe FERRANDO

 

De : Pcsclite-muscle [mailto:pcsclite-muscle-bounces+christophe.ferrando=[hidden email]] De la part de Ludovic Rousseau
Envoyé : mercredi 28 septembre 2016 09:59
À : Talks about MUSCLE <[hidden email]>
Objet : Re: [Pcsclite-muscle] ScardConnect SCARD_SHARE_DIRECT

 

2016-09-27 23:50 GMT+02:00 Christophe FERRANDO <[hidden email]>:

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


_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle