-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Plugout an PCSC device will raise ListReadersException(hresult) on windows #74
Comments
this problem trap on win10 , but work fine on win7
i use SCardGetErrorMessage print error message: the error mssage is "smartcard resource manager is closed"("智能卡资源管理器已关闭") . |
-2146435042L is 0x8010001E and is What should be the expected behaviour for you? |
After i plug in a device, the pyscard service should not stop. |
PySCard does not stop, but raises an exception. When a reader is plugged IN no exception is raised. |
When a reader is plugged OUT, ScardListReader methord should not raise an exception.But now it raises SCARD_E_SERVICE_STOPPED |
The exception
What should |
After reader is pluged OUT, the windows smartcard service does not really stop, so getReaderNames() should not raise an exception, it should return a list of reader(s). |
I don't know if PC/SC manager really stopped or not. But Do you get the error/exception if you have 2 reader connected and disconnect one, or only when you disconnect the last reader? |
i just have one reader contected, if it is plugged OUT, SCardListReaders() should not return an error but return an empty list . |
I got an new tip. |
I expected this behaviour with 2 readers. I propose you to:
|
OK,thanks,you help a lot. |
On Windows 10 the PC/SC manager is stopped when the latest reader is unplugged. LudovicRousseau/pyscard#75 LudovicRousseau/pyscard#27 LudovicRousseau/pyscard#74
On Windows 10 the PC/SC manager is stopped when the latest reader is unplugged. LudovicRousseau/pyscard#75 LudovicRousseau/pyscard#27 LudovicRousseau/pyscard#74
Fixed in bf906d3 |
…rd.Exceptions.ListReadersException error,-2146435043/8010001D
On Windows, when the last reader is removed the PC/SC manager is stopped. A PC/SC call will receive SCARD_E_SERVICE_STOPPED. The idea here is to renew the PC/SC context in getReaderNames(). Thanks to Lemon Gong for the patch "fix #74: plugout the last device will raise an smartcard.Exceptions #93" https://github.com/LudovicRousseau/pyscard/pull/93/files This change should also fix: - "Plugout an PCSC device will raise ListReadersException(hresult) on windows #74" #74 - "Windows smartcard service is started only once #114" #114
I use pyscard-1.9.17, but i got an problem which is similar to several.
1)Exception ListReadersException raised after disconnecting PCSC reader #13
2)Stop CardMonitor monitor thread after traceback print. #22
I guess that #13 #22 do not fixed the problem.
Here is my traceback info:
Traceback (most recent call last):
File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\CardMonitoring.py", line 162, in run
currentcards = self.cardrequest.waitforcardevent()
File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\CardRequest.py", line 73, in waitforcardevent
return self.pcsccardrequest.waitforcardevent()
File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\pcsc\PCSCCardRequest.py", line 288, in waitforcardevent
readernames = self.getReaderNames()
File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\pcsc\PCSCCardRequest.py", line 90, in getReaderNames
raise ListReadersException(hresult)
ListReadersException: ('Failed to list readers', -2146435042L)
The text was updated successfully, but these errors were encountered: