Fix smart card removal handling for older PC/SC
Older PC/SC doesn't have the code SCARD_E_NO_READERS_AVAILABLE, so fix the code to handle such systems as well.
This commit is contained in:
parent
9e9bdac2f1
commit
9ed5f63c17
|
@ -342,7 +342,12 @@ static int refresh_attributes(sc_reader_t *reader)
|
|||
}
|
||||
|
||||
/* the system could not detect the reader. It means, the prevoiusly attached reader is disconnected. */
|
||||
if (rv == (LONG)SCARD_E_UNKNOWN_READER || rv == (LONG)SCARD_E_NO_READERS_AVAILABLE || rv == (LONG)SCARD_E_SERVICE_STOPPED) {
|
||||
if (
|
||||
#ifdef SCARD_E_NO_READERS_AVAILABLE
|
||||
(rv == (LONG)SCARD_E_NO_READERS_AVAILABLE) ||
|
||||
#endif
|
||||
(rv == (LONG)SCARD_E_UNKNOWN_READER) || (rv == (LONG)SCARD_E_SERVICE_STOPPED)) {
|
||||
|
||||
if (old_flags & SC_READER_CARD_PRESENT) {
|
||||
reader->flags |= SC_READER_CARD_CHANGED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue