[Pcsclite-muscle] Windows PC/SC and SCARD_E_SERVICE_STOPPED
s.brunner at stephan-brunner.net
Sun Dec 26 11:08:43 PST 2021
A quick and dirty solution is to establish a new context when getting
SCARD_E_SERVICE_STOPPED. I had this situation myself when dealing with
this stuff. This method forces the service to start again and stay
alive, until the next time the last reader disconnects...
Looking in ProcMon and watching the service, I can't see any registry
key accessed which could change this behavior. A quick look thus deems
a hardcoded shutdown.
Apparently MS does not check whether a context (and thus a COM client)
is connected. Maybe it's a cheap oversight.
Or it's done on purpose: Maybe they are tired of software keeping
connected to a service where no real work can be done without any
reader connected? Maybe they try to force saving resources for some
Am Sunday, dem 26.12.2021 um 18:58 +0000 schrieb Diego de Felice:
> Just some info from my experience, being a developer of a smart card
> middleware: I started facing a weird problem from Windows 8 installed
> as virtual machine, the Smart Card service suddendly stopped after
> some times. After some search, I discovered that a new "feature" has
> been added to Windows, where services, despite being set as Automatic
> Start, they could be stopped automatically if no work is needed,
> imagine the surprise to know that "Smart Card Service" is stopped
> when no REAL smart card reader are connected to the machine... This
> is a big problem on VMs because there are no physical screader
> connected and this same behaviour cause my middleware big problems on
> really slow PCs: when Windows starts, sometimes the screader is
> recognized after the SCService starts, so... the service stops, and
> my middleware doesn't work!!! Still figuring out how to solve this
> problem, because it's very difficult to debug in dev environment.
> Hope it helps.
> Here the reference:
> pcsclite-muscle mailing list
> pcsclite-muscle at lists.infradead.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5612 bytes
Desc: not available
More information about the pcsclite-muscle