node-pcsclite icon indicating copy to clipboard operation
node-pcsclite copied to clipboard

Example wont run on Windows 10, stuck in while-loop?

Open pwik opened this issue 6 years ago • 5 comments

Operating system: Windows 10 Pro Node version: 11.6.0

The example program does not seem to run on Windows 10. It starts and gets stuck right before calling the imported pcsclite() function.

Quickly looking over the source code I think there may be a problem when calling SCardEstablishContext in the while-loop (postServiceCheck) in the src/pcsclite.cpp file (line 68). It may be the case that the library cannot properly start the smart card resource manager service or that it cannot establish a context to it for some reason. The library then gets stuck in the while loop preventing the example from running. I haven't properly debugged it, but that seems like a likely place for it to get stuck.

The example was run on a Windows 10 (Pro) machine that had never had a smart card device plugged in to it. The example seems to run fine on Win 10 machines that have seen a smart card device.

Is there a workaround for this issue?

pwik avatar Mar 16 '19 22:03 pwik

Added pull request for a potential fix #22.

pwik avatar Mar 25 '19 10:03 pwik

Hi @pwik, yesterday version 0.6.0 was released containing all sorts of bugfixes for the newest versions of Node.js as well as fixing the provided example usage. Can you please try again running your code? The library is running flawlessly on my Windows 10 machine now. I'll be happy to help you!

petrzjunior avatar Jan 26 '20 10:01 petrzjunior

I still have issues on 0.6.0 when I load the lib on devices that never had a Reader attached. I get the UAC-Prompt to change some windows service setting and then my application just hangs.

ChrisK2 avatar Jun 15 '20 07:06 ChrisK2

My application still hangs as well. Referring: https://github.com/pokusew/nfc-pcsc/issues/84

ghost avatar Jun 23 '21 11:06 ghost

Any updates on this? @petrzjunior @pokusew

[EDIT] I am running Node 17, but the same issue appears with Node 13.

[EDIT 2] I am working on a Mac, and was connected to a Windows 10 machine over RDP WITHOUT using smartcard redirection. The Windows 10 machine has it's own ACR122u directly connected to it via USB.

I decided to test locally without RDP and it works. So RDP is still doing something that's blocking PCSC from working properly.

ghost avatar Nov 30 '21 12:11 ghost