--- sourceforge.net/trunk/rdesktop/scard.c 2006/11/04 17:33:15 1329 +++ sourceforge.net/trunk/rdesktop/scard.c 2006/11/04 20:02:42 1330 @@ -606,8 +606,8 @@ rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext); if (rv) { - DEBUG_SCARD(("<--ERROR SCardEstablishContext Code=0x%.8x]-->\n", - (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardEstablishContext Code=0x%.8x, %s]-->\n", + (unsigned int) rv, pcsc_stringify_error(rv))); } else { @@ -636,7 +636,8 @@ if (rv) { - DEBUG_SCARD(("<--ERROR SCardReleaseContext Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardReleaseContext Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -669,8 +670,7 @@ if (rv) { - DEBUG_SCARD(("<--ERROR SCardListReaders (no SCardIsValidContext) Code=0x%.8x-->\n", - (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardListReaders (no SCardIsValidContext) Code=0x%.8x, %s-->\n", (unsigned int) rv, pcsc_stringify_error(rv))); rv = SCARD_E_INVALID_HANDLE; } else @@ -788,7 +788,8 @@ DEBUG_SCARD(("[MANGLED HCARD 0x%08x]\n", hCard)); if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardConnect Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardConnect Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -862,7 +863,8 @@ (MYPCSC_DWORD) dwInitialization, &dwActiveProtocol); if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardReconnect Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardReconnect Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -918,7 +920,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardDisconnect Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardDisconnect Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -1130,7 +1133,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardGetStatusChange Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardGetStatusChange Code=0x%.8x, %s-->\n", + (unsigned int) rv, pcsc_stringify_error(rv))); } else { @@ -1200,7 +1204,8 @@ rv = SCardCancel((MYPCSC_SCARDCONTEXT) hContext); if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardCancel Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardCancel Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -1269,7 +1274,7 @@ copyReaderState_MyPCSCToServer(myRsArray, rsArray, readerCount); if (rv != SCARD_S_SUCCESS) { - 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))); } else { @@ -1331,7 +1336,8 @@ rv = SCardBeginTransaction(myHCard); if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardBeginTransaction Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardBeginTransaction Code=0x%.8x, %s-->\n", + (unsigned int) rv, pcsc_stringify_error(rv))); } else { @@ -1362,7 +1368,8 @@ rv = SCardEndTransaction(myHCard, (MYPCSC_DWORD) dwDisposition); if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardEndTransaction Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardEndTransaction Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -1571,7 +1578,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardTransmit Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardTransmit Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -1668,7 +1676,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardStatus Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardStatus Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); return SC_returnCode(rv, &lcHandle, in, out); } else @@ -1779,8 +1788,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardStatus (no ScardState) Code=0x%.8x-->\n", - (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardStatus (no ScardState) Code=0x%.8x, %s-->\n", + (unsigned int) rv, pcsc_stringify_error(rv))); return SC_returnCode(rv, &lcHandle, in, out); } else @@ -1858,7 +1867,8 @@ if (rv) { - DEBUG_SCARD(("<--ERROR SCardListReaderGroups Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardListReaderGroups Code=0x%.8x, %s-->\n", + (unsigned int) rv, pcsc_stringify_error(rv))); return SC_returnCode(rv, &lcHandle, in, out); } else @@ -1949,7 +1959,8 @@ if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardGetAttrib Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardGetAttrib Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); return SC_returnCode(rv, &lcHandle, in, out); } else @@ -2017,7 +2028,8 @@ if (rv) { - DEBUG_SCARD(("<--ERROR SCardSetAttrib Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardSetAttrib Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else { @@ -2120,7 +2132,8 @@ #ifdef WITH_DEBUG_SCARD if (rv != SCARD_S_SUCCESS) { - DEBUG_SCARD(("<--ERROR SCardControl Code=0x%.8x-->\n", (unsigned int) rv)); + DEBUG_SCARD(("<--ERROR SCardControl Code=0x%.8x, %s-->\n", (unsigned int) rv, + pcsc_stringify_error(rv))); } else {