0

I had a working contactless system in Windows XP. But when I tried to run it under Win7 it fails in this sCardTransmit function even though it runs connect function well:

UCHAR ucAnswerL[255];
DWORD ucAnswerSizeL = 0;
BYTE            m_send[256];

ucAnswerSizeL = 255;
m_send[0] = 0x00;
m_send[1] = 0x12;
m_send[2] = 0x00;
m_send[3] = 0x00;
m_send[4] = 0x00;
m_ls = 5; 
uiRc = SCardTransmit(m_hSmartCardHandle, (m_dwAP==SCARD_PROTOCOL_T0?SCARD_PCI_T0:SCARD_PCI_T1), m_send, m_ls, NULL, ucAnswerL, &ucAnswerSizeL);

uiRc is set to 801000002 which means:

public const uint E_CANCELLED = 0x80100002;

The same code in XP system returns 0 (success).

What should be the problem?

Btw. Where can I find the instruction codes sent in pbSendBuffer mentioned here:

official website of winscard.h

ibrahim demir
  • 421
  • 3
  • 16
  • The typical place to look for instruction codes (for class [the byte with index=0] 0) is ISO 7816-4. Your mentioned 0x12 is from 7816-7 meaning Perform Transaction Operation. The used token may define additional instructions and some are recognized and either handled directly or transformed to another one by the reader. – guidot Apr 09 '15 at 07:17
  • @guidot I have found this document for 7816-4 as you mentioned: http://www.embedx.com/pdfs/ISO_STD_7816/info_isoiec7816-4%7Bed2.0%7Den.pdf I looked for reset command in document, but there is nothing like reset. Also I have searched for 7816-7 commands, what I found was a complete commands: http://www.wrankl.de/JavaPC/Commands.html Consequently, I am surprised because I couldn't find anything like reset command in anywhere. Is there a reset command really exists at somewhere? – ibrahim demir Apr 15 '15 at 13:57

0 Answers0