Skip to content

Commit

Permalink
IFDPowerICC(): Fix internal use of IFDStatusICC()
Browse files Browse the repository at this point in the history
IFDStatusICC() is not a IFDHandler function but a ifdwrapper function.
It returns SCARD_* values and not IFD_* values.

By luck, the code was not broken because we have
IFD_SUCCESS = SCARD_S_SUCCESS = 0
  • Loading branch information
LudovicRousseau committed May 11, 2017
1 parent cbe677f commit b024b2a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ifdwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,8 @@ LONG IFDPowerICC(READER_CONTEXT * rContext, DWORD dwAction,
* Check that the card is inserted first
*/
rv = IFDStatusICC(rContext, &dwStatus);
if (rv != IFD_SUCCESS)
{
if (rv == IFD_NO_SUCH_DEVICE)
return SCARD_E_READER_UNAVAILABLE;

return SCARD_E_NOT_TRANSACTED;
}
if (rv != SCARD_S_SUCCESS)
return rv;

if (dwStatus & SCARD_ABSENT)
return SCARD_W_REMOVED_CARD;
Expand Down

0 comments on commit b024b2a

Please sign in to comment.