<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Same behaviour.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Please find the source code and the log file.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Source Code :<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><stdio.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><stdlib.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><errno.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><string.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><time.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><sys/time.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><PCSC/winscard.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><PCSC/reader.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#include</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'><wintypes.h></span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>#define</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(f, rv) \</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>if</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> (SCARD_S_SUCCESS != rv) \</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> { \</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>  printf(f </span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>":[%<u>lx</u>] %s\n"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv, pcsc_stringify_error(rv)); \</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>  </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>return</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -1; \</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> }</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>int</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> <b>main</b>(</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>int</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> argc,</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>char</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> * argv[] )</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>{</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>LONG</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv;</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>SCARDCONTEXT</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> hContext;</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>LPTSTR</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> mszReaders;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>SCARDHANDLE</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> hCard;</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>DWORD</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> dwReaders, dwActiveProtocol, dwRecvLength;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><b><u><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>unsigned</span></u></b><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span></u><b><u><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>char</span></u></b><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> *pbAttr;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>DWORD</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> dwAttrLen;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>DWORD</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> dwState, dwProtocol, dwAtrLen, dwReaderLen;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>BYTE</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> *pbAtr = NULL;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><b><u><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>char</span></u></b><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> *pcReader = NULL;</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><u><span style='font-size:10.0pt;font-family:"Courier New";color:#005032;mso-fareast-language:EN-US'>SCARD_READERSTATE</span></u><u><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rgReaderStates[2];</span></u><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;mso-fareast-language:EN-US'>SCardEstablishContext</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>(SCARD_SCOPE_USER, NULL, NULL, &hContext);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"SCardEstablishContext"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv)</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;mso-fareast-language:EN-US'>SCardConnect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>(hContext,</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"<u>Microchip</u> SEC1110 [CCID Interface] (72DE091F) 00 00"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>,</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>             SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"SCardConnect"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;mso-fareast-language:EN-US'>SCardEndTransaction</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>(hCard,SCARD_LEAVE_CARD);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"SCardEndTransaction"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;mso-fareast-language:EN-US'>SCardDisconnect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>(hCard, SCARD_LEAVE_CARD);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"SCardDisconnect"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv)</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;mso-fareast-language:EN-US'>SCardReleaseContext</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>(hContext);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;mso-fareast-language:EN-US'>"SCardReleaseContext"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>, rv);</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;mso-fareast-language:EN-US'>return</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'> 0;</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-US'>}</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Sincerly,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>Christophe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>De :</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Pcsclite-muscle [mailto:pcsclite-muscle-bounces+christophe.ferrando=sylyca.com@lists.alioth.debian.org] <b>De la part de</b> Ludovic Rousseau<br><b>Envoyé :</b> mercredi 18 mai 2016 15:47<br><b>À :</b> Talks about MUSCLE <pcsclite-muscle@lists.alioth.debian.org><br><b>Objet :</b> Re: [Pcsclite-muscle] SCARD_E_NOT_TRANSACTED<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal>2016-05-17 16:30 GMT+02:00 Christophe FERRANDO <<a href="mailto:christophe.ferrando@sylyca.com" target="_blank">christophe.ferrando@sylyca.com</a>>:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>Hi,</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Hello,<br> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>I currently use pcsc-lite version 1.8.15.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>If i use these instructions (C Program)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880;background:silver'>SCardEstablishContext</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(SCARD_SCOPE_USER, NULL, NULL, &hContext);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"SCardEstablishContext"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, rv)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880'>SCardConnect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(hContext,</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"<u>My Drive</u>"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>                         SCARD_SHARE_EXCLUSIVE,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"SCardConnect"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, rv);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880'>SCardEndTransaction</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(hCard,SCARD_LEAVE_CARD);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"SCardEndTransaction"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, rv);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880'>SCardDisconnect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(hCard, SCARD_LEAVE_CARD);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"SCardDisconnect"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, rv)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               rv = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#642880'>SCardReleaseContext</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(hContext);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>               CHECK(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"SCardReleaseContext"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, rv)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>I have no errors.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>I expected SCARD_E_NOT_TRANSACTED because i call ScardEndTransaction without a previous call to ScardBeginTransaction.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#57585A'>But the result of SCardEndTransaction is E_SUCCESS.</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>That is strange.<br>On my side I get the expected behavior:<br>SCardEndTransaction: Transaction failed. 0x80100016<br> <o:p></o:p></p></div></div><p class=MsoNormal>Can you share your complete source code?<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>Can you also generate a pcscd trace as documented in <a href="http://pcsclite.alioth.debian.org/pcsclite.html#support">http://pcsclite.alioth.debian.org/pcsclite.html#support</a><o:p></o:p></p></div><div><p class=MsoNormal>Thanks<br clear=all><o:p></o:p></p></div><div><p class=MsoNormal><br>-- <o:p></o:p></p><div><p class=MsoNormal> Dr. Ludovic Rousseau<o:p></o:p></p></div></div></div></div></body></html>