On 18.11.2009, at 18:27, Ludovic Rousseau wrote: > 2009/11/18 Martin Paljak <[email protected]>: >> Hi. >> >> From SCardControl documentation: >> """ >> This function sends a command directly to the IFD Handler (reader driver) to >> be processed by the reader. >> """ >> If that is the case, is it reasonable/designed that it returns card related >> errors like: >> >> SCARD_W_RESET_CARD >> SCARD_W_REMOVED_CARD > > These error codes are not returned by pcsc-lite. I removed them from > the documentation in revision 4558. > I also added SCARD_E_INVALID_PARAMETER that may be returned.
The way I see it, they are returned by the call to RFCheckReaderEventState(rContext, hCard) in PCSC/src/winscard.h, in SCardControl(), line 1407 (is there a way to link to pcsc-lite source with line numbers?), relating the function to a card, before anything is sent to the ifdhandler. Out of the control codes supported by the CCID ifdhandler, it is somewhat premature for these control codes (which, as I understand, do not result in card communication, ever): IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE and IOCTL_FEATURE_MCT_READERDIRECT (not 100% sure as I have not implemented those) CM_IOCTL_GET_FEATURE_REQUEST IOCTL_FEATURE_IFD_PIN_PROPERTIES But valid for these (which will do card communication and where card events make sense): IOCTL_FEATURE_VERIFY_PIN_DIRECT IOCTL_FEATURE_MODIFY_PIN_DIRECT As the card state is checked on pcsc-lite level, it is not OK or even possible to check the semantics of the control codes. One way could be postponing the check for reader event states after the ifdhandler returns an error. So both return codes are valid from SCardControl, but returned at bad times, IMO? I could write a patch for this, if this solution is OK. -- Martin Paljak http://martin.paljak.pri.ee +372.515.6495 _______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
