Having only a handle and context to a PCSC reader using winscard
on Windows >= XP, is there some way to get its device instance id or something else that can be used in the SetupDi*
API to find out which driver is loaded for said reader.
SCardGetReaderDeviceInstanceId
is only available on Windows 8, so unfortunately not for me.
As a plan B, all smart card readers could be enumerated in SetupDi
using the smart card reader class guid. But then I would need a unique attribute to be able to correlate a reader between SCard*
API and SetupDi*
API. For example, the serial number sounds like a good candidate, but not all manufacturers use it.
Any ideas?
From my tests, it seams that scard service assigns the name in this order:
a) SPDRP_FRIENDLYNAME if present
b) SPDRP_DEVICEDESC
This way, I was able to match the SCardListReaders() names with the rigth Device/Driver.
Hope this helps ...