Search code examples
.netwindows-7smartcardsmartcard-reader

Hang With ScardConnectA on Win 7 64bit


I am updating a smart card application (.net 2 using winscard.dll) to run on Windows 7. Only minor changes are required for 32bit. Under 64bit there appears to be a hang calling SCardConnectA - it sits and does not return. Stopping the smart card service/removing the card allows the application to complete.

The .net app uses interop so to rule this out, I have tried calling scardconnectA from a C++ Dll with the same result. This occurs on TODOS and Gemalto devices. So far in the application it has clearly setup and talked to the reader and determined presence of a card.

Any suggestions on how to investigate? Is there a timeout value I can apply here?

Thanks,

Davy Mitchell


Solution

  • I now have a solution (apologies for taking a few days to get it up here).

    Appears there is a behaviour change in 64bit Windows 7. There was a BeginTransaction without an EndTransaction in the application and this appears to have been causing the hang. For some reason 32bit Windows was forgiving of this.

    Thanks again to all those who left a message.

    Davy Mitchell