开发者

Hang With ScardConnectA on Win 7 64bit

开发者 https://www.devze.com 2023-01-20 15:52 出处:网络
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 sit

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开发者_JS百科 .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


You would have to work with the respective manufacturers to arrive at a solution. You didn't post any snippet to verify that you did something wrong, I doubt it if you have double-checked the behavior in a native program. And there a few ways to fumble the arguments. Using the Unicode version, like everybody else does, would be a remote chance.

This is a difficult kind of support request, you are working with two parties, Microsoft and the card vendor, they are liable to point fingers at each other. Your only real hope for a quick workaround is to force your app to run in 32-bit mode by setting the Target platform setting to x86.


Most card readers inlcude a separate installer for 64 bit drivers and 32 bit drivers - gemalto definitely does this (see http://support.gemalto.com/?id=46 for an example page with multiple reader installers for different architectures).

Have you double checked to ensure that you are using 64 bit drivers under the 64bit OS?


  • Why do you use SCardConnectA instead of SCardConnect?
  • A hanging SCardConnect can mean that there's another application doing something with that card, are you sure that this is not the case?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消