在 Win 7 64 位上使用 ScardConnectA 挂起

发布于 2024-09-28 07:06:42 字数 338 浏览 4 评论 0原文

我正在更新一个智能卡应用程序(使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

戏蝶舞 2024-10-05 07:06:42

您必须与相应的制造商合作才能找到解决方案。您没有发布任何代码片段来验证您是否做错了什么,我怀疑您是否仔细检查了本机程序中的行为。有几种方法可以解决这些论点。像其他人一样,使用 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.

你的笑 2024-10-05 07:06:42

大多数读卡器都包含 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?

挽容 2024-10-05 07:06:42
  • 为什么使用 SCardConnectA 而不是 SCardConnect?
  • 挂起的 SCardConnect 可能意味着有另一个应用程序正在对该卡执行某些操作,您确定情况不是这样吗?
  • 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?
单调的奢华 2024-10-05 07:06:42

我现在有了一个解决方案(很抱歉花了几天时间才把它放在这里)。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文