With regards to my last post, I have further isolated the bug causing
PC/SC exceptions, made the appropriate code changes and verified the
correction.

Cause of the bug:
----------------------------------------
I�m my previous post I suggested that the bug was in OpenCard�s PC/SC
bridge.  More precisely, IBM�s com.ibm.opencard.terminal.pcsc10 is the
culprit.  I stated that the SCardListReaders would return the current
readers plugged in and this WOULD be true if not for a bug in the
OFCPCSC1.DLL file.

Regarding the native function which calls SCardListReaders(), in line
551 is the comment, �the first parameter <context> is not needed. query
is not directed to a specific context�

While this function �can� be called without a valid context
(SCARDCONTEXT) the results differ!!!
When SCardListReaders() is called with NULL for the context, the
returned readers list includes ALL INSTALLED READERS!!!!!!!  This is
because that information is available through the Windows registry
alone, without needing a context.  But when a valid context is given,
you receive ONLY PLUGGED IN READERS!!!!!!.

Affect of the bug:
---------------------------------------
Typically, you would make calls to SCardGetStatusChange() with the list
of all plugged in readers.  However, the CardTerminal class issues this
PC/SC command one at a time for each individual reader that it �thinks�
is available.  Because this list now might contain non-plugged in
readers, SCardGetStatusChange() is given an SCARD_READERSTATE array with
only a single element and that element might be a reader not plugged
into the computer at that time.  That is the reason for the
SCARD_E_NO_READERS_AVAILABLE error (0x8010002e).

I tested this with my own PC/SC code in C++ and confirmed this.

I then made some code changes to OFCPCSC1.CPP.  Within the native
function for getting the list of readers, I query the PC/SC for a new
context and send that valid context along with the SCardListReaders().
I briefly tested the new version of OFCPCSC1.DLL and it worked to
correct the flaw!!!!!!!!!!!

Would anyone like my new version of OFCPCSC1.DLL??

Should it be posted somewhere?

-Alan

Alan Kozlay� Software/Hardware Engineer
Biometric Associates, Inc.
[EMAIL PROTECTED]
www.biometricassociates.com
9475 Deerco Rd. Suite 410
Lutherville, MD 21093
(410) 252-7210 desk
(410) 252-7214 fax





---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe
! in the body.

Reply via email to