Event notification for ::SCardListReaders()

0

In the PC/SC (Personal Computer Smart Card) Appln, I have (MSCAPI USB CCID based)

1) Calling ::SCardListReaders() returns SCARD_E_NO_READERS_AVAILABLE (0x8010002E). This call is made after OS starts fresh after reboot, from a thread which is part of my custom windows service.

2) Adding delay before ::SCardListReaders() call solves the problem.

3) How can I solve this problem elegantly ? Not using delay & waiting for some event to notify me.

since a) Different machines may require different delay values b) Cannot loop since the error code is genuine c) Could not find this event as part of System Event Notification Service or similar COM interface d) platform is Windows 7

Any Help Appreciated.

visual-c++
windows-7
com
smartcard
hardware-interface
asked on Stack Overflow Aug 25, 2014 by dpb • edited Aug 25, 2014 by dpb

1 Answer

0

Option1)

Using SCardGetStatusChange() by setting in its parameter readerstate.szReader to "\\?PnP?\Notification"

Option2)

Polling after fixed interval with limit on maximum interval to poll

answered on Stack Overflow Aug 27, 2014 by dpb

User contributions licensed under CC BY-SA 3.0