On Thu, 27 Jun 2002, David Corcoran wrote: > You could always just do a SCardStatus or another command which validates > the hCard. Why do you need to validate it ? If you have made a > connection using SCardConnect ?
Yes, I establish a connection to the card, send some APDUs and cache some card information in the host application. That way I can avoid many transactions with the card and speed up the application, but it has the potential of showing inconsistent behaviour: for example, the card has been removed but the application is not aware because the operations it's requesting still succeed - they are served based on the cached data. I would like to make sure that the SCARDHANDLE I am using to communicate with the card is still valid before using any cached data. One sure method of accomplishing this is sending a "dummy" APDU using that SCARDHANDLE, but this method is *slow* which is exactly what I'm trying to avoid. I have tried using SCardStatus() and SCardGetStatusChange(), but they both fail to detect the case when the card has been removed and then inserted again; the SCARDHANDLE is still valid according to these functions, but my connection is no longer valid and I'll only detect that when I try to send an APDU. > > On Thu, 27 Jun 2002, Arturo Garcia Ares wrote: > > > Hi, > > > > What's the preferred method of "validating" a SCARDHANDLE, i.e, checking > > if it's still valid, without resorting to sending a "dummy" APDU? > > > > Thanks, > > > > Arturo > > *************************************************************** Unix Smart Card Developers - M.U.S.C.L.E. (Movement for the Use of Smart Cards in a Linux Environment) http://www.linuxnet.com/ To unsubscribe send an email to [EMAIL PROTECTED] with unsubscribe sclinux ***************************************************************
