1

Problem: My programm can differentiate between two types of cards: smartcards and simple eeprom cards(Typ AT24C02SC).

I get the following error into windows system event log:

Smart Card Reader 'SCM Microsystems Inc. SCR33x USB Smart Card Reader 0' rejected IOCTL 0x3136b0: The request is not supported. If this error persists, your smart card or reader may not be functioning correctly.

Command Header: 86 XX XX XX

Pseudocode (I work with winscard.dll and MCSCM.dll):

void readCard()
{
   winscard.SCardEstablishContext();
   winscard.SCardListReaders();
   winscard.SCardGetStatusChange();

   while (card is not present)
   {
   }

   // test if card is eeprom card
   if (MCSCM.MCardInitialize() == 0)
   {
      if (MCSCM.MCardConnect() == 0)
      {
         MCSCM.MCardReadMemory();
         isMCard = true;
      }
   }
   MCSCM.MCardDisconnect();
   MCSCM.MCardShutdown();

   // if not, try if it is smartcard
   if (winscard.SCardConnect() == true && isMCard == false)
   {
      winscard.SCardConnect();
      ...
      // send apdus
   }
   winscard.SCardDisconnect();
   winscard.SCardReleaseContext();
   }

I get this error when there is a smartcard in my reader and I check if it is an eeprom card with ConnectMCard(). I have to check two different card types for eeprom card first, because the winscard.dll function SCardConnect() returns 0 (SUCCESS) for every card (eeprom or smartcard).

This is working but there should be a better way.

kinske
  • 597
  • 8
  • 24
F3rdiFuchs
  • 11
  • 4
  • Support of non-smart cards is non-standard grey area, and manufacturer solutions vary considerably. All of the readers I encountered, synthesized an ATR for cards not offering a real one; this also applies to contactless cards. My proposal is, to try smart card first and if the returned ATR (SCardGetAttrib) returns the synthetic pattern, then to fall back into memory card branch. – guidot Dec 18 '15 at 13:28

0 Answers0