1

I've been struggling to find a way for listing only locally available SmartCard readers. Or at least differentiate between local readers and readers shared via RDP session.

I'm using SCardListReaders, but that lists all readers registered into the SmartCard subsystem, including readers from RDP shares. Are there any way to filter that list?

One way would be to list physical reader devices with SetupDiGetClassDevs, then use SCardListReadersWithDeviceInstanceId. But i need to have Windows 7 support and SCardListReadersWithDeviceInstanceId was introduced from Windows 8.

Any alternative solution is also appreciated.

nothingam
  • 165
  • 1
  • 12
  • Match SmartCard with Setup is a direction. See [this](https://stackoverflow.com/a/42798497/11128312). – Strive Sun Sep 20 '19 at 10:03
  • I'm aware of that question, but i couldn't match the names from the smart card subsystem against the information gathered from SetupAPI. It seems from the comments they couldn't do it either (at least with 100% precision). I might do an another trial with that code again as a last resort. – nothingam Sep 23 '19 at 15:08

1 Answers1

0

You can use the SCARD_SCOPE_SYSTEM constant for dwScope parameter when calling SCardEstablishContext

Remote SmartCard readers can only exists inside of user context.

Alexander
  • 1,232
  • 1
  • 15
  • 24