<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>pcsc-lite: error.c Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">pcsc-lite <span id="projectnumber">1.7.2</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_7a4553ee0c3b13d0e595a5d1659110a6.html">src</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">error.c</div> </div> </div> <div class="contents"> <a href="error_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * MUSCLE SmartCard Development ( http://www.linuxnet.com )</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 1999-2002</span> <a name="l00005"></a>00005 <span class="comment"> * David Corcoran <corcoran@linuxnet.com></span> <a name="l00006"></a>00006 <span class="comment"> * Copyright (C) 2006-2009</span> <a name="l00007"></a>00007 <span class="comment"> * Ludovic Rousseau <ludovic.rousseau@free.fr></span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * This file is dual licenced:</span> <a name="l00010"></a>00010 <span class="comment"> * - BSD-like, see the COPYING file</span> <a name="l00011"></a>00011 <span class="comment"> * - GNU Lesser General Licence 2.1 or (at your option) any later version.</span> <a name="l00012"></a>00012 <span class="comment"> *</span> <a name="l00013"></a>00013 <span class="comment"> * $Id: error.c 5287 2010-10-10 12:52:00Z rousseau $</span> <a name="l00014"></a>00014 <span class="comment"> */</span> <a name="l00015"></a>00015 <a name="l00021"></a>00021 <span class="preprocessor">#include <stdio.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <sys/types.h></span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#include "config.h"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "misc.h"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="pcsclite_8h.html" title="This keeps a list of defines for pcsc-lite.">pcsclite.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="strlcpycat_8h.html" title="prototypes of strlcpy()/strlcat() imported from OpenBSD">strlcpycat.h</a>"</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="preprocessor">#ifdef NO_LOG</span> <a name="l00030"></a>00030 <span class="preprocessor"></span>PCSC_API <span class="keywordtype">char</span>* <a class="code" href="group__API.html#gab5c302876c4c8187143603837a41aa86" title="This function return a human readable text for the given PC/SC error code.">pcsc_stringify_error</a>(<span class="keyword">const</span> <span class="keywordtype">long</span> pcscError) <a name="l00031"></a>00031 { <a name="l00032"></a>00032 <span class="keyword">static</span> <span class="keywordtype">char</span> strError[] = <span class="stringliteral">"0x12345678"</span>; <a name="l00033"></a>00033 <a name="l00034"></a>00034 snprintf(strError, <span class="keyword">sizeof</span>(strError), <span class="stringliteral">"0x%08lX"</span>, pcscError); <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="keywordflow">return</span> strError; <a name="l00037"></a>00037 } <a name="l00038"></a>00038 <span class="preprocessor">#else</span> <a name="l00039"></a>00039 <span class="preprocessor"></span> <a name="l00057"></a><a class="code" href="group__API.html#gab5c302876c4c8187143603837a41aa86">00057</a> PCSC_API <span class="keywordtype">char</span>* <a class="code" href="group__API.html#gab5c302876c4c8187143603837a41aa86" title="This function return a human readable text for the given PC/SC error code.">pcsc_stringify_error</a>(<span class="keyword">const</span> LONG pcscError) <a name="l00058"></a>00058 { <a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">char</span> strError[75]; <a name="l00060"></a>00060 <a name="l00061"></a>00061 <span class="keywordflow">switch</span> (pcscError) <a name="l00062"></a>00062 { <a name="l00063"></a>00063 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a4a3c56f69570971d366642a563b34a75" title="error codes from http://msdn.microsoft.com/en-us/library/aa924526.aspx">SCARD_S_SUCCESS</a>: <a name="l00064"></a>00064 (void)strlcpy(strError, <span class="stringliteral">"Command successful."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00065"></a>00065 <span class="keywordflow">break</span>; <a name="l00066"></a>00066 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a081a564acaf166f74592906f7dff2d86" title="An internal consistency check failed.">SCARD_F_INTERNAL_ERROR</a>: <a name="l00067"></a>00067 (void)strlcpy(strError, <span class="stringliteral">"Internal error."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00068"></a>00068 <span class="keywordflow">break</span>; <a name="l00069"></a>00069 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a48cf91681fb2c14902bd41888cb5cf08" title="The action was cancelled by an SCardCancel request.">SCARD_E_CANCELLED</a>: <a name="l00070"></a>00070 (void)strlcpy(strError, <span class="stringliteral">"Command cancelled."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00071"></a>00071 <span class="keywordflow">break</span>; <a name="l00072"></a>00072 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a05bdea2f2341e78d920885d1cc357676" title="The supplied handle was invalid.">SCARD_E_INVALID_HANDLE</a>: <a name="l00073"></a>00073 (void)strlcpy(strError, <span class="stringliteral">"Invalid handle."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00074"></a>00074 <span class="keywordflow">break</span>; <a name="l00075"></a>00075 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a47a6da10ec4ea2cbebfcc4b2a93d786f" title="One or more of the supplied parameters could not be properly interpreted.">SCARD_E_INVALID_PARAMETER</a>: <a name="l00076"></a>00076 (void)strlcpy(strError, <span class="stringliteral">"Invalid parameter given."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00077"></a>00077 <span class="keywordflow">break</span>; <a name="l00078"></a>00078 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a37b498229179904babd93afd6e3c03d0" title="Registry startup information is missing or invalid.">SCARD_E_INVALID_TARGET</a>: <a name="l00079"></a>00079 (void)strlcpy(strError, <span class="stringliteral">"Invalid target given."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00080"></a>00080 <span class="keywordflow">break</span>; <a name="l00081"></a>00081 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a81694393a1494d5091145734a2f0b36c" title="Not enough memory available to complete this command.">SCARD_E_NO_MEMORY</a>: <a name="l00082"></a>00082 (void)strlcpy(strError, <span class="stringliteral">"Not enough memory."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00083"></a>00083 <span class="keywordflow">break</span>; <a name="l00084"></a>00084 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aa27c83c6206e99f70e3245dde0ea3d13" title="An internal consistency timer has expired.">SCARD_F_WAITED_TOO_LONG</a>: <a name="l00085"></a>00085 (void)strlcpy(strError, <span class="stringliteral">"Waited too long."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00086"></a>00086 <span class="keywordflow">break</span>; <a name="l00087"></a>00087 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aac3f8d945f8a0e667e0926daaa18dc57" title="The data buffer to receive returned data is too small for the returned data.">SCARD_E_INSUFFICIENT_BUFFER</a>: <a name="l00088"></a>00088 (void)strlcpy(strError, <span class="stringliteral">"Insufficient buffer."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00089"></a>00089 <span class="keywordflow">break</span>; <a name="l00090"></a>00090 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a1bc24e84bfe33ef68be7251e2423190a" title="The specified reader name is not recognized.">SCARD_E_UNKNOWN_READER</a>: <a name="l00091"></a>00091 (void)strlcpy(strError, <span class="stringliteral">"Unknown reader specified."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00092"></a>00092 <span class="keywordflow">break</span>; <a name="l00093"></a>00093 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aa01265b3f55d4f18cdeb4f9cd736b508" title="The user-specified timeout value has expired.">SCARD_E_TIMEOUT</a>: <a name="l00094"></a>00094 (void)strlcpy(strError, <span class="stringliteral">"Command timeout."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00095"></a>00095 <span class="keywordflow">break</span>; <a name="l00096"></a>00096 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a81cd3fc9e7e84c66be2471294152235f" title="The smart card cannot be accessed because of other connections outstanding.">SCARD_E_SHARING_VIOLATION</a>: <a name="l00097"></a>00097 (void)strlcpy(strError, <span class="stringliteral">"Sharing violation."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00098"></a>00098 <span class="keywordflow">break</span>; <a name="l00099"></a>00099 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aaf69330d6d119872ef76ae81c6b826db" title="The operation requires a Smart Card, but no Smart Card is currently in the device.">SCARD_E_NO_SMARTCARD</a>: <a name="l00100"></a>00100 (void)strlcpy(strError, <span class="stringliteral">"No smart card inserted."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00101"></a>00101 <span class="keywordflow">break</span>; <a name="l00102"></a>00102 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#adf23d3987de9c052ac5270feb7fedd02" title="The specified smart card name is not recognized.">SCARD_E_UNKNOWN_CARD</a>: <a name="l00103"></a>00103 (void)strlcpy(strError, <span class="stringliteral">"Unknown card."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00104"></a>00104 <span class="keywordflow">break</span>; <a name="l00105"></a>00105 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a4dce3229ccced27e83dc55666024201c" title="The system could not dispose of the media in the requested manner.">SCARD_E_CANT_DISPOSE</a>: <a name="l00106"></a>00106 (void)strlcpy(strError, <span class="stringliteral">"Cannot dispose handle."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00107"></a>00107 <span class="keywordflow">break</span>; <a name="l00108"></a>00108 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a36d821a0458f935ddbe345f10408a988" title="The requested protocols are incompatible with the protocol currently in use with the smart card...">SCARD_E_PROTO_MISMATCH</a>: <a name="l00109"></a>00109 (void)strlcpy(strError, <span class="stringliteral">"Card protocol mismatch."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00110"></a>00110 <span class="keywordflow">break</span>; <a name="l00111"></a>00111 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aad8800bcf34cd97d4a4b0c3fbd3d955e" title="The reader or smart card is not ready to accept commands.">SCARD_E_NOT_READY</a>: <a name="l00112"></a>00112 (void)strlcpy(strError, <span class="stringliteral">"Subsystem not ready."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00113"></a>00113 <span class="keywordflow">break</span>; <a name="l00114"></a>00114 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a9ece9fd9e68e4f802e16e951f8f2a642" title="One or more of the supplied parameters values could not be properly interpreted.">SCARD_E_INVALID_VALUE</a>: <a name="l00115"></a>00115 (void)strlcpy(strError, <span class="stringliteral">"Invalid value given."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00116"></a>00116 <span class="keywordflow">break</span>; <a name="l00117"></a>00117 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#afac3f9a28c745c434ea73d416041b9e5" title="The action was cancelled by the system, presumably to log off or shut down.">SCARD_E_SYSTEM_CANCELLED</a>: <a name="l00118"></a>00118 (void)strlcpy(strError, <span class="stringliteral">"System cancelled."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00119"></a>00119 <span class="keywordflow">break</span>; <a name="l00120"></a>00120 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a93d3cf468d69423eab1d478a7a870408" title="An internal communications error has been detected.">SCARD_F_COMM_ERROR</a>: <a name="l00121"></a>00121 (void)strlcpy(strError, <span class="stringliteral">"RPC transport error."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00122"></a>00122 <span class="keywordflow">break</span>; <a name="l00123"></a>00123 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a27abb2c7397e0b23939cf216111d4e9a" title="An internal error has been detected, but the source is unknown.">SCARD_F_UNKNOWN_ERROR</a>: <a name="l00124"></a>00124 (void)strlcpy(strError, <span class="stringliteral">"Unknown error."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00125"></a>00125 <span class="keywordflow">break</span>; <a name="l00126"></a>00126 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ad0df4eb97723df11170751f91c537893" title="An ATR obtained from the registry is not a valid ATR string.">SCARD_E_INVALID_ATR</a>: <a name="l00127"></a>00127 (void)strlcpy(strError, <span class="stringliteral">"Invalid ATR."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00128"></a>00128 <span class="keywordflow">break</span>; <a name="l00129"></a>00129 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ab02a33c2ef61f12a851dfe85c575d7cc" title="An attempt was made to end a non-existent transaction.">SCARD_E_NOT_TRANSACTED</a>: <a name="l00130"></a>00130 (void)strlcpy(strError, <span class="stringliteral">"Transaction failed."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00131"></a>00131 <span class="keywordflow">break</span>; <a name="l00132"></a>00132 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ad70bc694ffdf40c3b494d9239160d69d" title="The specified reader is not currently available for use.">SCARD_E_READER_UNAVAILABLE</a>: <a name="l00133"></a>00133 (void)strlcpy(strError, <span class="stringliteral">"Reader is unavailable."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00134"></a>00134 <span class="keywordflow">break</span>; <a name="l00135"></a>00135 <span class="comment">/* case SCARD_P_SHUTDOWN: */</span> <a name="l00136"></a>00136 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a47505641191236c5e46afcd4a74ad1ae" title="The PCI Receive buffer was too small.">SCARD_E_PCI_TOO_SMALL</a>: <a name="l00137"></a>00137 (void)strlcpy(strError, <span class="stringliteral">"PCI struct too small."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00138"></a>00138 <span class="keywordflow">break</span>; <a name="l00139"></a>00139 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a0d2e5857f22e108a8cb8e6ea18cd82cf" title="The reader driver does not meet minimal requirements for support.">SCARD_E_READER_UNSUPPORTED</a>: <a name="l00140"></a>00140 (void)strlcpy(strError, <span class="stringliteral">"Reader is unsupported."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00141"></a>00141 <span class="keywordflow">break</span>; <a name="l00142"></a>00142 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a83cb6a41253c9489393d67eee14fc698" title="The reader driver did not produce a unique reader name.">SCARD_E_DUPLICATE_READER</a>: <a name="l00143"></a>00143 (void)strlcpy(strError, <span class="stringliteral">"Reader already exists."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00144"></a>00144 <span class="keywordflow">break</span>; <a name="l00145"></a>00145 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a118d0e1151d8e2ebde37bc2cf7232f1a" title="The smart card does not meet minimal requirements for support.">SCARD_E_CARD_UNSUPPORTED</a>: <a name="l00146"></a>00146 (void)strlcpy(strError, <span class="stringliteral">"Card is unsupported."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00147"></a>00147 <span class="keywordflow">break</span>; <a name="l00148"></a>00148 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ad4729ab109ff490285d2ad881c04bee8" title="The Smart card resource manager is not running.">SCARD_E_NO_SERVICE</a>: <a name="l00149"></a>00149 (void)strlcpy(strError, <span class="stringliteral">"Service not available."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00150"></a>00150 <span class="keywordflow">break</span>; <a name="l00151"></a>00151 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a262c34297ab1b65db1c9516ccc0dd9a0" title="The Smart card resource manager has shut down.">SCARD_E_SERVICE_STOPPED</a>: <a name="l00152"></a>00152 (void)strlcpy(strError, <span class="stringliteral">"Service was stopped."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00153"></a>00153 <span class="keywordflow">break</span>; <a name="l00154"></a>00154 <span class="comment">/* case SCARD_E_UNEXPECTED: */</span> <a name="l00155"></a>00155 <span class="comment">/* case SCARD_E_ICC_CREATEORDER: */</span> <a name="l00156"></a>00156 <span class="comment">/* case SCARD_E_UNSUPPORTED_FEATURE: */</span> <a name="l00157"></a>00157 <span class="comment">/* case SCARD_E_DIR_NOT_FOUND: */</span> <a name="l00158"></a>00158 <span class="comment">/* case SCARD_E_NO_DIR: */</span> <a name="l00159"></a>00159 <span class="comment">/* case SCARD_E_NO_FILE: */</span> <a name="l00160"></a>00160 <span class="comment">/* case SCARD_E_NO_ACCESS: */</span> <a name="l00161"></a>00161 <span class="comment">/* case SCARD_E_WRITE_TOO_MANY: */</span> <a name="l00162"></a>00162 <span class="comment">/* case SCARD_E_BAD_SEEK: */</span> <a name="l00163"></a>00163 <span class="comment">/* case SCARD_E_INVALID_CHV: */</span> <a name="l00164"></a>00164 <span class="comment">/* case SCARD_E_UNKNOWN_RES_MNG: */</span> <a name="l00165"></a>00165 <span class="comment">/* case SCARD_E_NO_SUCH_CERTIFICATE: */</span> <a name="l00166"></a>00166 <span class="comment">/* case SCARD_E_CERTIFICATE_UNAVAILABLE: */</span> <a name="l00167"></a>00167 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a81b59e9319d3fcd0d957d98781b3ebd2" title="Cannot find a smart card reader.">SCARD_E_NO_READERS_AVAILABLE</a>: <a name="l00168"></a>00168 (void)strlcpy(strError, <span class="stringliteral">"Cannot find a smart card reader."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00169"></a>00169 <span class="keywordflow">break</span>; <a name="l00170"></a>00170 <span class="comment">/* case SCARD_E_COMM_DATA_LOST: */</span> <a name="l00171"></a>00171 <span class="comment">/* case SCARD_E_NO_KEY_CONTAINER: */</span> <a name="l00172"></a>00172 <span class="comment">/* case SCARD_E_SERVER_TOO_BUSY: */</span> <a name="l00173"></a>00173 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ad85c133e557498eb50ce9992e0568de9" title="The reader cannot communicate with the card, due to ATR string configuration conflicts.">SCARD_W_UNSUPPORTED_CARD</a>: <a name="l00174"></a>00174 (void)strlcpy(strError, <span class="stringliteral">"Card is not supported."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00175"></a>00175 <span class="keywordflow">break</span>; <a name="l00176"></a>00176 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a359a9e85e3b7c83c76507a096452b74f" title="The smart card is not responding to a reset.">SCARD_W_UNRESPONSIVE_CARD</a>: <a name="l00177"></a>00177 (void)strlcpy(strError, <span class="stringliteral">"Card is unresponsive."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00178"></a>00178 <span class="keywordflow">break</span>; <a name="l00179"></a>00179 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#ad7d27393bc1ba813e6f9042fe8e9eca7" title="Power has been removed from the smart card, so that further communication is not possible.">SCARD_W_UNPOWERED_CARD</a>: <a name="l00180"></a>00180 (void)strlcpy(strError, <span class="stringliteral">"Card is unpowered."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00181"></a>00181 <span class="keywordflow">break</span>; <a name="l00182"></a>00182 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#a20fbb8319646f26c4ad7f237d1a64f0c" title="The smart card has been reset, so any shared state information is invalid.">SCARD_W_RESET_CARD</a>: <a name="l00183"></a>00183 (void)strlcpy(strError, <span class="stringliteral">"Card was reset."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00184"></a>00184 <span class="keywordflow">break</span>; <a name="l00185"></a>00185 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aa2efd953946973972b1afc5d0343820c" title="The smart card has been removed, so further communication is not possible.">SCARD_W_REMOVED_CARD</a>: <a name="l00186"></a>00186 (void)strlcpy(strError, <span class="stringliteral">"Card was removed."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00187"></a>00187 <span class="keywordflow">break</span>; <a name="l00188"></a>00188 <span class="comment">/* case SCARD_W_SECURITY_VIOLATION: */</span> <a name="l00189"></a>00189 <span class="comment">/* case SCARD_W_WRONG_CHV: */</span> <a name="l00190"></a>00190 <span class="comment">/* case SCARD_W_CHV_BLOCKED: */</span> <a name="l00191"></a>00191 <span class="comment">/* case SCARD_W_EOF: */</span> <a name="l00192"></a>00192 <span class="comment">/* case SCARD_W_CANCELLED_BY_USER: */</span> <a name="l00193"></a>00193 <span class="comment">/* case SCARD_W_CARD_NOT_AUTHENTICATED: */</span> <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="keywordflow">case</span> <a class="code" href="pcsclite_8h.html#aef39984cd0dd3822088099fffd9d5f96" title="This smart card does not support the requested feature.">SCARD_E_UNSUPPORTED_FEATURE</a>: <a name="l00196"></a>00196 (void)strlcpy(strError, <span class="stringliteral">"Feature not supported."</span>, <span class="keyword">sizeof</span>(strError)); <a name="l00197"></a>00197 <span class="keywordflow">break</span>; <a name="l00198"></a>00198 <span class="keywordflow">default</span>: <a name="l00199"></a>00199 (void)snprintf(strError, <span class="keyword">sizeof</span>(strError)-1, <span class="stringliteral">"Unknown error: 0x%08lX"</span>, <a name="l00200"></a>00200 pcscError); <a name="l00201"></a>00201 }; <a name="l00202"></a>00202 <a name="l00203"></a>00203 <span class="comment">/* add a null byte */</span> <a name="l00204"></a>00204 strError[<span class="keyword">sizeof</span>(strError)-1] = <span class="charliteral">'\0'</span>; <a name="l00205"></a>00205 <a name="l00206"></a>00206 <span class="keywordflow">return</span> strError; <a name="l00207"></a>00207 } <a name="l00208"></a>00208 <span class="preprocessor">#endif</span> <a name="l00209"></a>00209 <span class="preprocessor"></span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Sep 15 2011 for pcsc-lite by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>