606 |
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext); |
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext); |
607 |
if (rv) |
if (rv) |
608 |
{ |
{ |
609 |
DEBUG_SCARD(("<--ERROR SCardEstablishContext Code=0x%.8x]-->\n", |
DEBUG_SCARD(("<--ERROR SCardEstablishContext Code=0x%.8x, %s]-->\n", |
610 |
(unsigned int) rv)); |
(unsigned int) rv, pcsc_stringify_error(rv))); |
611 |
} |
} |
612 |
else |
else |
613 |
{ |
{ |
636 |
|
|
637 |
if (rv) |
if (rv) |
638 |
{ |
{ |
639 |
DEBUG_SCARD(("<--ERROR SCardReleaseContext Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardReleaseContext Code=0x%.8x, %s-->\n", (unsigned int) rv, |
640 |
|
pcsc_stringify_error(rv))); |
641 |
} |
} |
642 |
else |
else |
643 |
{ |
{ |
670 |
|
|
671 |
if (rv) |
if (rv) |
672 |
{ |
{ |
673 |
DEBUG_SCARD(("<--ERROR SCardListReaders (no SCardIsValidContext) Code=0x%.8x-->\n", |
DEBUG_SCARD(("<--ERROR SCardListReaders (no SCardIsValidContext) Code=0x%.8x, %s-->\n", (unsigned int) rv, pcsc_stringify_error(rv))); |
|
(unsigned int) rv)); |
|
674 |
rv = SCARD_E_INVALID_HANDLE; |
rv = SCARD_E_INVALID_HANDLE; |
675 |
} |
} |
676 |
else |
else |
788 |
DEBUG_SCARD(("[MANGLED HCARD 0x%08x]\n", hCard)); |
DEBUG_SCARD(("[MANGLED HCARD 0x%08x]\n", hCard)); |
789 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
790 |
{ |
{ |
791 |
DEBUG_SCARD(("<--ERROR SCardConnect Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardConnect Code=0x%.8x, %s-->\n", (unsigned int) rv, |
792 |
|
pcsc_stringify_error(rv))); |
793 |
} |
} |
794 |
else |
else |
795 |
{ |
{ |
863 |
(MYPCSC_DWORD) dwInitialization, &dwActiveProtocol); |
(MYPCSC_DWORD) dwInitialization, &dwActiveProtocol); |
864 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
865 |
{ |
{ |
866 |
DEBUG_SCARD(("<--ERROR SCardReconnect Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardReconnect Code=0x%.8x, %s-->\n", (unsigned int) rv, |
867 |
|
pcsc_stringify_error(rv))); |
868 |
} |
} |
869 |
else |
else |
870 |
{ |
{ |
920 |
|
|
921 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
922 |
{ |
{ |
923 |
DEBUG_SCARD(("<--ERROR SCardDisconnect Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardDisconnect Code=0x%.8x, %s-->\n", (unsigned int) rv, |
924 |
|
pcsc_stringify_error(rv))); |
925 |
} |
} |
926 |
else |
else |
927 |
{ |
{ |
1133 |
|
|
1134 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1135 |
{ |
{ |
1136 |
DEBUG_SCARD(("<--ERROR SCardGetStatusChange Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardGetStatusChange Code=0x%.8x, %s-->\n", |
1137 |
|
(unsigned int) rv, pcsc_stringify_error(rv))); |
1138 |
} |
} |
1139 |
else |
else |
1140 |
{ |
{ |
1204 |
rv = SCardCancel((MYPCSC_SCARDCONTEXT) hContext); |
rv = SCardCancel((MYPCSC_SCARDCONTEXT) hContext); |
1205 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1206 |
{ |
{ |
1207 |
DEBUG_SCARD(("<--ERROR SCardCancel Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardCancel Code=0x%.8x, %s-->\n", (unsigned int) rv, |
1208 |
|
pcsc_stringify_error(rv))); |
1209 |
} |
} |
1210 |
else |
else |
1211 |
{ |
{ |
1274 |
copyReaderState_MyPCSCToServer(myRsArray, rsArray, readerCount); |
copyReaderState_MyPCSCToServer(myRsArray, rsArray, readerCount); |
1275 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1276 |
{ |
{ |
1277 |
DEBUG_SCARD(("<--ERROR SCardGetStatusChange (no SCardLocateCardsByATR) Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardGetStatusChange (no SCardLocateCardsByATR) Code=0x%.8x, %s-->\n", (unsigned int) rv, pcsc_stringify_error(rv))); |
1278 |
} |
} |
1279 |
else |
else |
1280 |
{ |
{ |
1336 |
rv = SCardBeginTransaction(myHCard); |
rv = SCardBeginTransaction(myHCard); |
1337 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1338 |
{ |
{ |
1339 |
DEBUG_SCARD(("<--ERROR SCardBeginTransaction Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardBeginTransaction Code=0x%.8x, %s-->\n", |
1340 |
|
(unsigned int) rv, pcsc_stringify_error(rv))); |
1341 |
} |
} |
1342 |
else |
else |
1343 |
{ |
{ |
1368 |
rv = SCardEndTransaction(myHCard, (MYPCSC_DWORD) dwDisposition); |
rv = SCardEndTransaction(myHCard, (MYPCSC_DWORD) dwDisposition); |
1369 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1370 |
{ |
{ |
1371 |
DEBUG_SCARD(("<--ERROR SCardEndTransaction Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardEndTransaction Code=0x%.8x, %s-->\n", (unsigned int) rv, |
1372 |
|
pcsc_stringify_error(rv))); |
1373 |
} |
} |
1374 |
else |
else |
1375 |
{ |
{ |
1578 |
|
|
1579 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1580 |
{ |
{ |
1581 |
DEBUG_SCARD(("<--ERROR SCardTransmit Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardTransmit Code=0x%.8x, %s-->\n", (unsigned int) rv, |
1582 |
|
pcsc_stringify_error(rv))); |
1583 |
} |
} |
1584 |
else |
else |
1585 |
{ |
{ |
1676 |
|
|
1677 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1678 |
{ |
{ |
1679 |
DEBUG_SCARD(("<--ERROR SCardStatus Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardStatus Code=0x%.8x, %s-->\n", (unsigned int) rv, |
1680 |
|
pcsc_stringify_error(rv))); |
1681 |
return SC_returnCode(rv, &lcHandle, in, out); |
return SC_returnCode(rv, &lcHandle, in, out); |
1682 |
} |
} |
1683 |
else |
else |
1788 |
|
|
1789 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1790 |
{ |
{ |
1791 |
DEBUG_SCARD(("<--ERROR SCardStatus (no ScardState) Code=0x%.8x-->\n", |
DEBUG_SCARD(("<--ERROR SCardStatus (no ScardState) Code=0x%.8x, %s-->\n", |
1792 |
(unsigned int) rv)); |
(unsigned int) rv, pcsc_stringify_error(rv))); |
1793 |
return SC_returnCode(rv, &lcHandle, in, out); |
return SC_returnCode(rv, &lcHandle, in, out); |
1794 |
} |
} |
1795 |
else |
else |
1867 |
|
|
1868 |
if (rv) |
if (rv) |
1869 |
{ |
{ |
1870 |
DEBUG_SCARD(("<--ERROR SCardListReaderGroups Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardListReaderGroups Code=0x%.8x, %s-->\n", |
1871 |
|
(unsigned int) rv, pcsc_stringify_error(rv))); |
1872 |
return SC_returnCode(rv, &lcHandle, in, out); |
return SC_returnCode(rv, &lcHandle, in, out); |
1873 |
} |
} |
1874 |
else |
else |
1959 |
|
|
1960 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
1961 |
{ |
{ |
1962 |
DEBUG_SCARD(("<--ERROR SCardGetAttrib Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardGetAttrib Code=0x%.8x, %s-->\n", (unsigned int) rv, |
1963 |
|
pcsc_stringify_error(rv))); |
1964 |
return SC_returnCode(rv, &lcHandle, in, out); |
return SC_returnCode(rv, &lcHandle, in, out); |
1965 |
} |
} |
1966 |
else |
else |
2028 |
|
|
2029 |
if (rv) |
if (rv) |
2030 |
{ |
{ |
2031 |
DEBUG_SCARD(("<--ERROR SCardSetAttrib Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardSetAttrib Code=0x%.8x, %s-->\n", (unsigned int) rv, |
2032 |
|
pcsc_stringify_error(rv))); |
2033 |
} |
} |
2034 |
else |
else |
2035 |
{ |
{ |
2132 |
#ifdef WITH_DEBUG_SCARD |
#ifdef WITH_DEBUG_SCARD |
2133 |
if (rv != SCARD_S_SUCCESS) |
if (rv != SCARD_S_SUCCESS) |
2134 |
{ |
{ |
2135 |
DEBUG_SCARD(("<--ERROR SCardControl Code=0x%.8x-->\n", (unsigned int) rv)); |
DEBUG_SCARD(("<--ERROR SCardControl Code=0x%.8x, %s-->\n", (unsigned int) rv, |
2136 |
|
pcsc_stringify_error(rv))); |
2137 |
} |
} |
2138 |
else |
else |
2139 |
{ |
{ |