[Pcsclite-muscle] PCSC proxy mode and READER_STATE struct

Andrey Af public.irkutsk at gmail.com
Sun Oct 29 00:20:12 PDT 2023


Hi Ludovic,
I found my mistake, I confused SCARD_STATE from PCSC and SCARD_STATE
from Microsoft.

>
> Le ven. 27 oct. 2023 à 10:36, Andrey Af <public.irkutsk at gmail.com> a écrit :
> >
> > Hi all, I use the pcsc-lite-1.8.24 API.
>
> Hello,
>
> > So, PCSC API call to SCardGetStatusChange does the conversion from
> > READER_STATE to CARDREADER_STATE.
> > But I have an internal myScardGetStatusChange call and I get a ready
> > SCARD READER_STATE.
> >
> > How do I do the reverse conversion, from SCARD_READER_STATE to
> > READER_STATE, so that  SCardGetStatusChange is working?
> > I have variables dwCurrentState, dwEventState and need to get
> > readerState variable.
>
> I don't know what you call SCARD_READER_STATE.
>
> > Sample code what am I doing:
> >
> > (dwCurrentState, dwEventState, rgbAtr[]) = myGetStatusChange(hContext,
> > dwTimeout, readerName, dwCurrentState, dwEventState, rgbAtr[]);
> >
> > if(dwEventState & ReaderStateChanged)
> > {
> >    READER_STATE[x].readerState = dwEventState & ReaderStatePresent ?
> > CardReaderStatePresent : CardReaderStateAbsent;
> > }
> >
> > And returned READER_STATE[] from unix socket, for CMD_GET_READERS_STATE.
>
> You are trying to talk directly on the pcscd/libcsclite1 communication socket.
> This is not supported or documented.

Ok. let's say I implemented an interface for the RDP protocol.
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpesc/60d5977d-0017-4c90-ab0c-f34bf44a74a5

So, I have all these calls - EstablishContext, ListReaders,
GetStatusChange ant etc.
I want to deliver remote smartcards to a local system. How do I
interact with the PCSC-LITE API?
Please tell me the right way.

>
> > When scanning, I get the token information, and then after a while -
> > "Card state: Card removed"
>
> You should first describe what you want to do at a high level.
> For example what do you call "proxy mode"?
>
> Bye
>
> --
>  Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list