[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-smartcardddk
Subject:    Re: Resend Why SmartCardDeviceControl not work?
From:       John Raven <jraven () JRAVEN ! COM>
Date:       2000-03-05 17:47:21
[Download RAW message or body]


Well...

That's not the Device state it is talking about.
The one that it is complaining about here is
     SmartcardExtension.ReaderCapabilities.CurrentState
These are defined in:
    Winsmcrd.h
And will be exciting things like:
     SCARD_ABSENT
    SCARD_PRESENT
    SCARD_NEGOTIABLE
    SCARD_SPECEFIC

You have to be at SPECIFIC (that is a Card is inserted, swallowd and a
Protocol established) before proceeding.
If no Protocol is established (by CurrentState's defiition), it will just
kick it back at you.

- John

 -----Original Message-----
From:   SmartCardDDK [mailto:SmartCardDDK@DISCUSS.MICROSOFT.COM]  On Behalf
Of SUBSCRIBE SmartCardDDK Yuping Shi
Sent:   Sunday, March 05, 2000 5:09 AM
To:     SmartCardDDK@DISCUSS.MICROSOFT.COM
Subject:        Resend Why SmartCardDeviceControl not work?

John:

   Many Thanks

   You are right.It could call back my card power management function
already!

   but i encounter another problem when i use IOCTL_SMARTCARD_TRANSMIT with
 SCARD_PROTOCOL_RAW,

  // SCARD_IO_REQUEST header
   memcpy(InBuf,"\x00\x01\x00\x00",4); //dwProtocol:SCARD_PROTOCOL_RAW
   memcpy(InBuf+4,"\x00\x00\x00\x08",4); //cbPciLength:8
   memcpy(InBuf+8,"\x00\x84\x00\x00\x04",5); //My ICC command
   InBufSize=13;
   OutBufSize=256;

   if(DeviceIoControl(hDriver,
                         (DWORD)IOCTL_SMARTCARD_TRANSMIT,
                         (LPVOID)InBuf,
                         InBufSize,
                         (LPVOID)OutBuf,
                         OutBufSize,
                         &cbReturned,
                         0
                         ))
    {
       printf("Output data is:\n");
        for (i=0;i<10;i++)
          printf(" %2x ",OutBuf[i]);
    }
 else
 {
   printf("Call DeviceIoControl Error:%ld\n",GetLastError());
    }

   It always return STATUS_INVALID_IO_DEVICE_STATE(I see it on windows
debuger)

   but these are the related parameters setting in my driver as follows:

    SmartcardExtension->CardCapabilities.Protocol.Supported = (ULONG)
SCARD_PROTOCOL_RAW;
    SmartcardExtension->CardCapabilities.Protocol.Selected = (ULONG)
SCARD_PROTOCOL_RAW;

    SmartcardExtension->ReaderCapabilities.CurrentState = (ULONG)
SCARD_SPECIFIC;

  // This reader supports T=0 ,T=1 and raw
   SmartcardExtension->ReaderCapabilities.SupportedProtocols
=SCARD_PROTOCOL_RAW | SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1;

   I don't know what is the valid device state?

   Do  you have any suggestions?

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic