在 Win 7 64 位上使用 ScardConnectA 挂起
我正在更新一个智能卡应用程序(使用winscard.dll 的.net 2)以在Windows 7 上运行。32 位只需要进行微小的更改。在 64 位下,调用 SCardConnectA 似乎会挂起 - 它会驻留且不会返回。停止智能卡服务/取出卡即可完成应用程序。
.net 应用程序使用互操作,因此为了排除这种情况,我尝试从 C++ Dll 调用 scardconnectA ,结果相同。这种情况发生在 TODOS 和 Gemalto 设备上。到目前为止,在应用程序中它已经清楚地设置并与读卡器对话并确定卡的存在。
关于如何调查有什么建议吗?我可以在这里应用一个超时值吗?
谢谢,
戴维·米切尔
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您必须与相应的制造商合作才能找到解决方案。您没有发布任何代码片段来验证您是否做错了什么,我怀疑您是否仔细检查了本机程序中的行为。有几种方法可以解决这些论点。像其他人一样,使用 Unicode 版本的机会很小。
这是一种困难的支持请求,您正在与微软和卡供应商两方合作,他们很容易互相指责。快速解决方法的唯一真正希望是通过将目标平台设置设置为 x86 来强制应用程序在 32 位模式下运行。
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.
大多数读卡器都包含 64 位驱动程序和 32 位驱动程序的单独安装程序 - gemalto 确实做到了这一点(请参阅 http: //support.gemalto.com/?id=46 示例页面包含针对不同架构的多个读卡器安装程序)。
您是否仔细检查过以确保您在 64 位操作系统下使用 64 位驱动程序?
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?
我现在有了一个解决方案(很抱歉花了几天时间才把它放在这里)。
64 位 Windows 7 中似乎存在行为更改。应用程序中存在 BeginTransaction 而没有 EndTransaction,这似乎导致了挂起。由于某种原因,32 位 Windows 对此是宽容的。
再次感谢所有留言的朋友。
戴维·米切尔
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