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.