Getting PCSC reader serial number with WinSCard

后端 未结 2 1321
醉酒成梦
醉酒成梦 2021-01-12 18:01

I have a problem with getting PCSC reader serial number if card is not present in the reader. I am using winscard.dll and c++.

The following code will work only for

相关标签:
2条回答
  • 2021-01-12 18:45

    You should be using:

    lReturn = SCardConnect(hResManager,szAvailRdr,SCARD_SHARE_SHARED,SCARD_PROTOCOL_T1,
                                &hCardHandle,
                                &dwActProtocol);
    

    Instead, try using:

    lReturn = SCardConnect(hResManager,szAvailRdr,SCARD_SHARE_DIRECT,
                          NULL,
                          &hCardHandle,
                          NULL);
    

    where szAvailRdr refers to the reader name (smartcard readername) and hCardHandle is a handle obtained before using scardconnect.

    This should keep you going!

    0 讨论(0)
  • 2021-01-12 18:54

    Maybe i'm a bit late - but anyway...

    You can connect directly to the card reader using the SCARD_SHARE_DIRECT flag with SCardConnect. At least with us this works fine.. (we use a protocol flag of "0x00")

    0 讨论(0)
提交回复
热议问题