如何调试基本 csp 微型驱动程序

发布于 2024-12-21 04:43:41 字数 110 浏览 3 评论 0原文

我想将调试器附加到 Windows 7 上的基本 csp 微型驱动程序。
哪个进程托管驱动程序 .dll?它只是另一个 WUDFHost.exe 吗?
我可以将用户模式调试器附加到该进程吗?

I'd like to attach a debugger to a base csp minidriver on windows 7.
Which process hosts the driver .dll? Is it just another WUDFHost.exe ?
Can I attach a user-mode debugger to that process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

霊感 2024-12-28 04:43:41

至少在使用 certutil.exe 时。 dll“直接”加载到进程中。
在 Visual Studio 中,可以将 certutil.exe 设置为调试面板中的命令,然后单步执行 minidriver.dll 的代码,从而测试 certutil 如何尝试访问智能卡。

At least when using certutil.exe the .dll is loaded "directly" into the process.
In Visual Studio one can set certutil.exe as the command in the Debugging panel and then step into the minidriver.dll's code and thereby test how certutil tries to access the smartcard.

剧终人散尽 2024-12-28 04:43:41

我做了简单的愚蠢的日志记录,而不是调试我的微型驱动程序。

使用 certutil 测试微型驱动程序很简单:

certutil.exe -SCInfo

调试微型驱动程序的想法是有偏差的。
对于 Windows 10,卡操作有5 秒超时。如果您在 5 秒内没有轮询该卡,您的卡将被操作系统重置。

错误如下所示:

智能卡读卡器“通用 EMV 智能卡读卡器 0”中的卡已重置,因为应用程序持有独占交易
保持卡上 5 秒无活动。如果此错误仍然存​​在,
该应用程序可能无法正常运行。

以下是微软对此的说法 :

Windows Server 2012、Windows 8 和 Windows 上的智能卡交易
RT,如果交易在卡上保留超过 5 秒
卡上没有发生任何操作,卡被重置。这是一个
与以前版本中的行为相比发生了变化。

为了健康调试,您必须引入一个单独的线程,使用 SCardStatusSCardGetAttrib 轮询您的卡状态,如 金雅拓做到了

避免系统在 5 秒后重置智能卡
超时,金雅拓建议您定期调用透明函数
像 SCardStatus 或 SCardGetAttrib 一样,在调用后使用计时器
SCardBeginTransaction。此更改也适用于 Windows 8、RT 和
Server 2012 系统。

I did simple stupid logging instead of debuging of my minidriver.

Testing your minidriver with certutil is easy:

certutil.exe -SCInfo

The idea of debugging a minidriver is bias.
For windows 10 there is a 5 second timeout to operate with a card. If you don't poll the card for 5 second you get your card reset by the operating system.

Here is how the error looks:

The card in Smart Card Reader 'Generic EMV Smartcard Reader 0' has been reset because an application held an exclusive transaction
on the card for 5 seconds without activity. If this error persists,
the application may not be functioning correctly.

Here is what Microsoft says about it:

Smart card transactions On Windows Server 2012, Windows 8, and Windows
RT, if a transaction is held on the card for more than 5 seconds with
no operations happening on the card, the card is reset. This is a
change from the behavior in previous releases.

For healthy debugging you have to introduce a separate thread that polls your card status with SCardStatus or SCardGetAttrib as Gemalto does

To avoid the system resetting the smart card after the 5-second
timeout, Gemalto recommends you regularly call a transparent function
like SCardStatus or SCardGetAttrib, using a timer, after calling
SCardBeginTransaction. This change also applies to Windows 8, RT and
Server 2012 systems.

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