SCARD_E_NOT_TRANSACTED

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

SCARD_E_NOT_TRANSACTED

Christophe FERRANDO

Hi,

 

I currently use pcsc-lite version 1.8.15.

 

If i use these instructions (C Program)

 

               rv = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);

               CHECK("SCardEstablishContext", rv)

               rv = SCardConnect(hContext,"My Drive",

                         SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);

               CHECK("SCardConnect", rv);

               rv = SCardEndTransaction(hCard,SCARD_LEAVE_CARD);

               CHECK("SCardEndTransaction", rv);

               rv = SCardDisconnect(hCard, SCARD_LEAVE_CARD);

               CHECK("SCardDisconnect", rv)

               rv = SCardReleaseContext(hContext);

               CHECK("SCardReleaseContext", rv)

 

I have no errors.

 

I expected SCARD_E_NOT_TRANSACTED because i call ScardEndTransaction without a previous call to ScardBeginTransaction.

But the result of SCardEndTransaction is E_SUCCESS.

 

Any ideas,

 

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: SCARD_E_NOT_TRANSACTED

Ludovic Rousseau
2016-05-17 16:30 GMT+02:00 Christophe FERRANDO <[hidden email]>:

Hi,


Hello,
 

 

I currently use pcsc-lite version 1.8.15.

 

If i use these instructions (C Program)

 

               rv = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);

               CHECK("SCardEstablishContext", rv)

               rv = SCardConnect(hContext,"My Drive",

                         SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);

               CHECK("SCardConnect", rv);

               rv = SCardEndTransaction(hCard,SCARD_LEAVE_CARD);

               CHECK("SCardEndTransaction", rv);

               rv = SCardDisconnect(hCard, SCARD_LEAVE_CARD);

               CHECK("SCardDisconnect", rv)

               rv = SCardReleaseContext(hContext);

               CHECK("SCardReleaseContext", rv)

 

I have no errors.

 

I expected SCARD_E_NOT_TRANSACTED because i call ScardEndTransaction without a previous call to ScardBeginTransaction.

But the result of SCardEndTransaction is E_SUCCESS.


That is strange.
On my side I get the expected behavior:
SCardEndTransaction: Transaction failed. 0x80100016
 
Can you share your complete source code?

Can you also generate a pcscd trace as documented in http://pcsclite.alioth.debian.org/pcsclite.html#support

Thanks

--
 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: SCARD_E_NOT_TRANSACTED

Christophe FERRANDO

Hi,

 

Same behaviour.

Please find the source code and the log file.

 

Source Code :

#include <stdio.h>

#include <stdlib.h>

#include <errno.h>

#include <string.h>

#include <time.h>

#include <sys/time.h>

#include <PCSC/winscard.h>

#include <PCSC/reader.h>

#include <wintypes.h>

 

 

#define CHECK(f, rv) \

if (SCARD_S_SUCCESS != rv) \

{ \

  printf(f ":[%lx] %s\n", rv, pcsc_stringify_error(rv)); \

  return -1; \

}

 

int main(int argc,char * argv[] )

{

LONG rv;

SCARDCONTEXT hContext;

LPTSTR mszReaders;

SCARDHANDLE hCard;

DWORD dwReaders, dwActiveProtocol, dwRecvLength;

unsigned char *pbAttr;

DWORD dwAttrLen;

DWORD dwState, dwProtocol, dwAtrLen, dwReaderLen;

BYTE *pbAtr = NULL;

char *pcReader = NULL;

SCARD_READERSTATE rgReaderStates[2];

 

rv = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);

CHECK("SCardEstablishContext", rv)

rv = SCardConnect(hContext,"Microchip SEC1110 [CCID Interface] (72DE091F) 00 00",

            SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);

CHECK("SCardConnect", rv);

rv = SCardEndTransaction(hCard,SCARD_LEAVE_CARD);

CHECK("SCardEndTransaction", rv);

rv = SCardDisconnect(hCard, SCARD_LEAVE_CARD);

CHECK("SCardDisconnect", rv)

rv = SCardReleaseContext(hContext);

CHECK("SCardReleaseContext", rv);

return 0;

}

 

 

 

Sincerly,

Christophe

 

De : Pcsclite-muscle [mailto:pcsclite-muscle-bounces+christophe.ferrando=[hidden email]] De la part de Ludovic Rousseau
Envoyé : mercredi 18 mai 2016 15:47
À : Talks about MUSCLE <[hidden email]>
Objet : Re: [Pcsclite-muscle] SCARD_E_NOT_TRANSACTED

 

2016-05-17 16:30 GMT+02:00 Christophe FERRANDO <[hidden email]>:

Hi,

 

Hello,
 

 

I currently use pcsc-lite version 1.8.15.

 

If i use these instructions (C Program)

 

               rv = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);

               CHECK("SCardEstablishContext", rv)

               rv = SCardConnect(hContext,"My Drive",

                         SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);

               CHECK("SCardConnect", rv);

               rv = SCardEndTransaction(hCard,SCARD_LEAVE_CARD);

               CHECK("SCardEndTransaction", rv);

               rv = SCardDisconnect(hCard, SCARD_LEAVE_CARD);

               CHECK("SCardDisconnect", rv)

               rv = SCardReleaseContext(hContext);

               CHECK("SCardReleaseContext", rv)

 

I have no errors.

 

I expected SCARD_E_NOT_TRANSACTED because i call ScardEndTransaction without a previous call to ScardBeginTransaction.

But the result of SCardEndTransaction is E_SUCCESS.

 

That is strange.
On my side I get the expected behavior:
SCardEndTransaction: Transaction failed. 0x80100016
 

Can you share your complete source code?


Can you also generate a pcscd trace as documented in http://pcsclite.alioth.debian.org/pcsclite.html#support

Thanks


--

 Dr. Ludovic Rousseau


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

log.txt (41K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SCARD_E_NOT_TRANSACTED

Ludovic Rousseau
2016-05-18 16:10 GMT+02:00 Christophe FERRANDO <[hidden email]>:

Hi,

 

Same behaviour.

Please find the source code and the log file.


I had not noticed that you use SCARD_SHARE_EXCLUSIVE.
I can now reproduce the problem.


Thanks

--
 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: SCARD_E_NOT_TRANSACTED

Richard Hackers

Hello my name richard I am studying a little about the THC SmartCard , actually he can read the card? it is possible to get all given the card important?

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