Sending APDU with winscard.dll (PC/SC) without a smart card connected

后端 未结 4 970
盖世英雄少女心
盖世英雄少女心 2021-01-26 16:38

I\'m trying to send APDU commands to the card reader itself instead of the Smart Card. The test command I\'m using turns the RF field on and off.

This commands sends ove

4条回答
  •  灰色年华
    2021-01-26 17:04

    I had a similar experience calling SCardTransmit after SCardConnect (receiving ERROR_INVALID_HANDLE <0x6> from SCardTransmit).

    As an experiment, putting Thread.Sleep(100) after SCardTransmit seemed to change the error code from 0x6 to SUCCESS after the sleep statement (as viewed in debugger). This is not a solution but a hint in the right direction. Writing thread safe code to process the statements after SCardControl would be a better way.

    The following link is a good reference:

    https://www.csharpstar.com/csharp-race-conditions-in-threading/

提交回复
热议问题