[Pcsclite-cvs-commit] r5347 - /trunk/PCSC/src/winscard.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Sat Oct 23 12:24:12 UTC 2010
Author: rousseau
Date: Sat Oct 23 12:24:05 2010
New Revision: 5347
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5347
Log:
SCardConnect(): power up the card before checking for its
SCARD_SWALLOWED state.
If a card fails to power up on card insertion a new power up will be
tried on SCardConnect().
Modified:
trunk/PCSC/src/winscard.c
Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=5347&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Sat Oct 23 12:24:05 2010
@@ -322,22 +322,22 @@
return SCARD_E_NO_SMARTCARD;
}
+ /* Power on (again) the card if needed */
+ if (POWER_STATE_UNPOWERED == rContext->powerState)
+ {
+ DWORD dwAtrLen;
+
+ dwAtrLen = sizeof(rContext->readerState->cardAtr);
+ rv = IFDPowerICC(rContext, IFD_POWER_UP,
+ rContext->readerState->cardAtr, &dwAtrLen);
+ rContext->readerState->cardAtrLength = dwAtrLen;
+ }
+
if (readerState & SCARD_SWALLOWED)
{
Log1(PCSC_LOG_ERROR, "Card Not Powered");
return SCARD_W_UNPOWERED_CARD;
}
- }
-
- /* Power on (again) the card if needed */
- if (POWER_STATE_UNPOWERED == rContext->powerState)
- {
- DWORD dwAtrLen;
-
- dwAtrLen = sizeof(rContext->readerState->cardAtr);
- rv = IFDPowerICC(rContext, IFD_POWER_UP,
- rContext->readerState->cardAtr, &dwAtrLen);
- rContext->readerState->cardAtrLength = dwAtrLen;
}
/* the card is now in use */
More information about the Pcsclite-cvs-commit
mailing list