Giter Club home page Giter Club logo

Comments (8)

LudovicRousseau avatar LudovicRousseau commented on August 25, 2024 2

Fixed in pcsc-lite 2.3.0.

See https://blog.apdu.fr/posts/2024/08/improved-scardgetstatuschange-for-pnpnotification-special-reader/

from pcsc.

kgraefe avatar kgraefe commented on August 25, 2024 1

Does it solve the problem for you?

yes it does! thank you 👍

from pcsc.

LudovicRousseau avatar LudovicRousseau commented on August 25, 2024

Yes, it is a known limitation of SCardGetStatusChange(). You can't detect a reader connection/disconnection between 2 calls of SCardGetStatusChange().

One solution would be to use dwEventState for the special reader \\?PnP?\Notification to store the number of reader events. If that number has changed between two calls of SCardGetStatusChange() then we return.

This field is already used by Windows to store the number of readers. I could not find the documentation for that.
See https://salsa.debian.org/rousseau/PCSC/-/issues/5

from pcsc.

kgraefe avatar kgraefe commented on August 25, 2024

Thank you for your response. IMHO an event count would be better as the number of readers may loose events if a reader is detached and another is attached between two calls of SCardGetStatusChange(). However, that seems rather theoretic and I cannot oversee the Windows / macOS situation.

I read your comment I don't think it is a good idea to implement something that would work for pcsc-lite only, and not for Windows or macOS. so that this will not / cannot be fixed any time soon, sadly. Feel free to close this ticket if you like.

from pcsc.

LudovicRousseau avatar LudovicRousseau commented on August 25, 2024

I may implement the idea I presented. It will only work on GNU/Linux but at least it would be possible to have a "safe" SCardGetStatusChange() on this platform.

I do not expect Apple or Microsoft to do anything on their own implementation of WinSCard.

from pcsc.

LudovicRousseau avatar LudovicRousseau commented on August 25, 2024

I think I fixed the issue in a beta version.
See http://lists.infradead.org/pipermail/pcsclite-muscle/2024-June/001498.html

from pcsc.

LudovicRousseau avatar LudovicRousseau commented on August 25, 2024

Hello @kgraefe
Have you had a chance to test my proposed code?
Does it solve the problem for you?

from pcsc.

kgraefe avatar kgraefe commented on August 25, 2024

It's on my list. I could not find the time yet.

from pcsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.