Smartcard reader naming: when removing any reader, the name of the rest changes

我只是一个虾纸丫 提交于 2019-12-08 14:37:42

问题


I am writting a smartcard application. This application connects card in reader and sometimes works with it. I need to watch when reader is no longer available (either card is ejected or reader is removed from USB).

Readers are watched using SCardStatusChange. This function requires reader name to watch.

I insert two readers with cards into USB slots. They are recognized as "USB Smart Card Reader 0" and "USB Smart Card Reader 1". I remove one reader. Windows says, "USB Smart Card Reader 1" is still connected. I insert it - again both available. Now I remove the second one. Windows still says "USB Smart Card Reader 1" is connected. And this is the problem because it should be "USB Smart Card Reader 0" which is still connected. Tracking routine can't watch reader because it's name is changed.

Is it a driver problem or XP smartcard subsystem problem? Driver used is USB CCID Compliant version 5.2.3790.1830 (VID 076B, PID A021), usbccid.sys.


回答1:


We ran into this problem on a project and handled it by iterating through each available reader and checking to see if a card is inserted in that reader. You will encounter this naming problem with several brands of usb readers.

My company has a product that lets you integrate smart cards with websites; one of our demos lists the smart card readers currently available and it might help you with testing different reader scenarios: https://cardboss.cometway.com/content.agent?page_name=GetReaders+Demo



来源:https://stackoverflow.com/questions/2636055/smartcard-reader-naming-when-removing-any-reader-the-name-of-the-rest-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!