Skip to content

Commit

Permalink
IFDPowerICC(): allow to use NULL for pucAtr and pdwAtrLen to make power
Browse files Browse the repository at this point in the history
down easy with IFDPowerICC(rContext, IFD_POWER_DOWN, NULL, NULL);


git-svn-id: svn:https://anonscm.debian.org/svn/pcsclite/trunk/PCSC@5314 0ce88b0d-b2fd-0310-8134-9614164e65ea
  • Loading branch information
LudovicRousseau committed Oct 13, 2010
1 parent dafe751 commit 2029125
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ifdwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ LONG IFDPowerICC(READER_CONTEXT * rContext, DWORD dwAction,
#endif
DWORD dwStatus;
UCHAR ucValue[1];
UCHAR dummyAtr[MAX_ATR_SIZE];
DWORD dummyAtrLen = sizeof(dummyAtr);

#ifndef PCSCLITE_STATIC_DRIVER
RESPONSECODE(*IFD_power_icc) (DWORD) = NULL;
Expand All @@ -346,6 +348,11 @@ LONG IFDPowerICC(READER_CONTEXT * rContext, DWORD dwAction,
dwStatus = 0;
ucValue[0] = 0;

if (NULL == pucAtr)
pucAtr = dummyAtr;
if (NULL == pdwAtrLen)
pdwAtrLen = &dummyAtrLen;

/*
* Check that the card is inserted first
*/
Expand Down

0 comments on commit 2029125

Please sign in to comment.