[Pcsclite-cvs-commit] Another transaction failed ...

Arnaud GARCIA Arnaud.Garcia@sim.hcuge.ch
Wed, 6 Apr 2005 17:12:12 +0200


--Apple-Mail-2--798337321
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

Hello,

A transaction failed on a SCardTransmit, with the SCARD_PROTOCOL_T0 but 
if I use SCARD_PROTOCOL_RAW I have a response (but not the good).

The connect Step is Ok
     rv = SCardConnect(hContext, mszReaders, SCARD_SHARE_SHARED, 
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
if I check dwActiveProtocol it is at SCARD_PROTOCOL_T0,
=> so T0 is accepted

the Transmit step (same code as usual ...):

DWORD dwSendLength, dwRecvLength;
     SCARD_IO_REQUEST pioRecvPci;
     SCARD_IO_REQUEST pioSendPci;
     pioRecvPci.dwProtocol = SCARD_PROTOCOL_T0;
     pioSendPci.dwProtocol = SCARD_PROTOCOL_T0;
     BYTE pbRecvBuffer[RCVBUF_SIZE];
     dwSendLength = sizeof(pbSendBuffer);
     dwRecvLength = sizeof(pbRecvBuffer);
     rv = SCardTransmit(hCard, &pioSendPci, pbSendBuffer, dwSendLength,
                        &pioRecvPci, pbRecvBuffer, &dwRecvLength);

// about the pbSendBuffer
it is a Select file command from a proprietary (so CLA is at 8A)
     BYTE seq1[] = { 0x8A, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00 };
this sequence has been tested on windows and it works...

I work on mac os x.

Any idea about this transaction failed with SCARD_PROTOCOL_T0, and why 
the commit pass if I try SCARD_PROTOCOL_RAW

thanks for help

arnaud


--Apple-Mail-2--798337321
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hello,<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>A transaction failed on =
a=A0<SPAN class=3D"Apple-style-span" style=3D"font-family: Monaco; =
font-size: 10px; ">SCardTransmit, with the=A0SCARD_PROTOCOL_T0 but if I =
use=A0SCARD_PROTOCOL_RAW I have a response (but not the =
good).</SPAN></DIV><DIV><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></DIV><DIV><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">The connect Step is Ok</SPAN></DIV><DIV><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0=A0 =
=A0</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">rv =3D SCardConnect(hContext, mszReaders, =
SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &amp;hCard, =
&amp;dwActiveProtocol);</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "></SPAN></DIV><DIV><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">if I check=A0dwActiveProtocol it is =
at=A0SCARD_PROTOCOL_T0,</SPAN></DIV><DIV><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=3D&gt; so T0 is =
accepted</SPAN></DIV><DIV><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></DIV><DIV><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">the Transmit step (same code as usual =
...):</SPAN></DIV><DIV><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></DIV><P style=3D"margin-top: =
0px; margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">DWORD dwSendLength, =
dwRecvLength;</SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; =
"><SPAN class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">SCARD_IO_REQUEST pioRecvPci;</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">SCARD_IO_REQUEST pioSendPci;</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">pioRecvPci.dwProtocol =3D =
SCARD_PROTOCOL_T0;</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">pioSendPci.dwProtocol =3D =
SCARD_PROTOCOL_T0;</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0</SPAN><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "> =A0 =
=A0</SPAN></SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; =
"><SPAN class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">BYTE pbRecvBuffer[RCVBUF_SIZE];</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0 =A0 =
</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">dwSendLength =3D </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(118, 15, 80); =
font-family: Monaco; font-size: 10px; ">sizeof</SPAN><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">(pbSendBuffer);</SPAN></P><P style=3D"margin-top: 0px; =
margin-bottom: 0px; "><SPAN class=3D"Apple-converted-tab"><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">=A0 =A0 </SPAN></SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">dwRecvLength =3D =
</SPAN><SPAN class=3D"Apple-style-span" style=3D"color: rgb(118, 15, =
80); font-family: Monaco; font-size: 10px; ">sizeof</SPAN><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">(pbRecvBuffer);</SPAN><SPAN class=3D"Apple-converted-tab"><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; "> =A0 =A0</SPAN></SPAN></P><P style=3D"margin-top: 0px; =
margin-bottom: 0px; "><SPAN class=3D"Apple-converted-tab"><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">=A0 =A0 </SPAN></SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">rv =3D =
SCardTransmit(hCard, &amp;pioSendPci, pbSendBuffer, =
dwSendLength,</SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; =
"><SPAN class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0</SPAN></SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "> =A0 </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">&amp;pioRecvPci, pbRecvBuffer, &amp;dwRecvLength);</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; "><BR class=3D"khtml-block-placeholder"></SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">// about the=A0pbSendBuffer</SPAN></P><P style=3D"margin-top: =
0px; margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">it is a Select file =
command from a proprietary (so CLA is at 8A)</SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-converted-tab"><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">=A0=A0 =
=A0</SPAN></SPAN><SPAN class=3D"Apple-style-span" style=3D"font-family: =
Monaco; font-size: 10px; ">BYTE seq1[] =3D { </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x8A</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0xA4</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x00</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x00</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x02</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x3F</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">, </SPAN><SPAN =
class=3D"Apple-style-span" style=3D"color: rgb(0, 0, 255); font-family: =
Monaco; font-size: 10px; ">0x00</SPAN><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "> };</SPAN><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; "></SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; =
"><SPAN class=3D"Apple-style-span" style=3D"font-family: Monaco; =
font-size: 10px; ">this sequence has been tested on windows and it =
works...</SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; =
"><SPAN class=3D"Apple-style-span" style=3D"font-family: Monaco; =
font-size: 10px; "><BR class=3D"khtml-block-placeholder"></SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">I work on mac os x.</SPAN></P><P style=3D"margin-top: 0px; =
margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></P><P style=3D"margin-top: =
0px; margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">Any idea about this =
transaction failed with=A0SCARD_PROTOCOL_T0, and why the commit pass if =
I try=A0SCARD_PROTOCOL_RAW</SPAN></P><P style=3D"margin-top: 0px; =
margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></P><P style=3D"margin-top: =
0px; margin-bottom: 0px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: Monaco; font-size: 10px; ">thanks for =
help</SPAN></P><P style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; "><BR class=3D"khtml-block-placeholder"></SPAN></P><P =
style=3D"margin-top: 0px; margin-bottom: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: Monaco; font-size: =
10px; ">arnaud</SPAN></P><P style=3D"margin-top: 0px; margin-bottom: =
0px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: Monaco; =
font-size: 10px; "><BR =
class=3D"khtml-block-placeholder"></SPAN></P></BODY></HTML>=

--Apple-Mail-2--798337321--