Getting PCSC reader serial number with WinSCard

后端 未结 2 1322
醉酒成梦
醉酒成梦 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!

提交回复
热议问题