Le 26/08/2011 16:40, Ludovic Rousseau a écrit : > 2011/8/25 Viktor Tarasov<viktor.tara...@gmail.com>: >> In the OpenSC context the detached reader/token is unknown before the >> SCardGetStatusChange() called. >> In windows, XP or Vista, the ScardGetStatusChange called for unknown reader >> returns SCARD_E_NO_READERS_AVAILABLE. >> >> The last revision of pcsc-lite, in such a case, returns the >> SCARD_E_UNKNOWN_READER, which seems to be more appropriate to the situation. > This is very strange. I do not have that on my Windows XP SP 3. > I compile and run the following program: > > // pcsc.cpp : main project file. > > #include "stdafx.h" > #include<stdio.h> > #include<winscard.h> > > using namespace System; > > int main(array<System::String ^> ^args) > { > LONG rv; > SCARDCONTEXT context; > SCARD_READERSTATE readers[2]; > > rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL,&context); > printf("%08X\n", rv); > > readers[0].szReader = L"foo"; > readers[1].szReader = L"bar"; > rv = SCardGetStatusChange(context, 100, readers, 2); > printf("%08X\n", rv); > > rv = SCardReleaseContext(context); > printf("%08X\n", rv); > > return 0; > } > > And I get as output: > 00000000 > 80100009 > 00000000 > > 80100009 is SCARD_E_UNKNOWN_READER. > So I do not get SCARD_E_NO_READERS_AVAILABLE as you do.
Ok, you have the SCARD_E_UNKNOWN_READER in the context of your test on 'your' Windows, I have SCARD_E_NO_READERS_AVAILABLE in the context of OpenSC on 'my' Windows . On 'my' Windows your Python test gives 'SCARD_E_NO_READERS_AVAILABLE' . I have no intention to perceive mysteries of Windows -- in any case both these errors has to be treated by OpenSC (as well as different behavior of the different pcsc-lite versions). And it's not complicated, because both these SCARD_E errors are translated by reader-pcsc.c into the same error SC_ERROR 'NO_READERS_FOUND'. For the OpenSC there is no difference between two SCARD_E errors and this difference has no impact onto the proposed solution for the bug with the detached token . Have you any comments for the proposed solution ? > Bye Kind regards, Viktor. _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel