-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCardGetStatusChange for PNP notification return SCARD_E_TIMEOUT #76
Comments
I also compiled the same project under the Windows platform and found that the SCardGetStatusChange for PNP notification returns the right value SCARD_S_SUCCESS as expected after run it under Windows platform. This difference under different platforms may cause issue under VDI user scenario. |
I can't reproduce your behavior on Windows.
And on Windows I get:
I receive 0x8010000A (SCARD_E_TIMEOUT) and not 0 (SCARD_S_SUCCESS). In your program I note you use |
Just as the way you mentioned how to compile the pcsc_scan.exe for Windows (https://ludovicrousseau.blogspot.com/2017/05/pcscscan-on-windows.html), I had compile it and put the exe into the attachment file. Please see the attached screen, you can see the log screen shot: Why the SCardGetStatusChange has the different result under Linux and Windows platform? |
Do not send me binary program. Send me the patch you used instead. On my side I tried with this patch:
And I confirm the returned value is
|
It is true that I modify the code as your patch do: But when I run the pcsc_scan.exe on my desktop win10 and win11, the result always zero. would you like to try the binary I provided on your desktop? |
Send me your source code instead. |
/home/test/pcsc-tools-master I also attach the zip file that include the modified .c file compiled exe. Please have a try on your windows. for sure when execute the pcsc_scan.exe app, I had attached the physical smart card reader& card to the Windows machine. |
I see the problem.
I get the expected But if I connect a reader before running pcsc_scan.exe I get:
I get the surprising This is surprising because in the two cases only the special reader What do you think? |
Yes, typical user scenario is that the physical smart card reader are attached before the pcsc_scan.exe executed. I think this is the expected result that return SCARD_S_SUCCESS at this scenario under Windows platform. Here I want to say the Under Linux platform the pcsc_scan return SCARD_E_TIMEOUT is a bad case. how can we fix this issue? |
For me it is a bug on Windows. Why is it important for you to change the behavior of |
For the latest pcsc_scan.c file, I add code at 528 line to check the SCardGetStatusChange return value for the PNP notification, but unfortunately the return value is SCARD_E_TIMEOUT but not SCARD_S_SUCCESS. (my local pcsc-lite version is 1.8.23 and ubuntu Linux)
_rgReaderStates[0].szReader = "\\?PnP?\Notification";
rgReaderStates[0].dwCurrentState = SCARD_STATE_UNAWARE;
rv = SCardGetStatusChange(hContext, 0, rgReaderStates, 1);
printf("SCardGetStatusChange for PNP notification result = %lu\n", rv)_
I think it should be SCARD_S_SUCCESS but not this SCARD_E_TIMEOUT value. Do you know why and do you have the plan to fix this issue?
The text was updated successfully, but these errors were encountered: