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.

Bye

-- 
 Dr. Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to