哪些客户端正在使用驱动程序?

发布于 2024-10-31 21:48:59 字数 135 浏览 1 评论 0原文

我需要其中一个驱动程序处于空闲状态(已加载到设备上,但根本没有使用)来获取一些统计信息。我需要确保没有线程/客户端正在使用该驱动程序。我想看看是否有办法实现此目的,以便我可以以编程方式终止/停用正在使用驱动程序的客户端/线程(如果有)以确保其空闲。请建议。

I need one of the drivers to be idle (loaded on the device, but not being used at all) to get some statistics. I need to make sure that no threads/clients are using the driver. I am trying to see if there is a way to achieve this so I can programatically kill/deactivate the clients/threads, if any, that are using the driver to make sure it is idle. Please suggest.

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

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

发布评论

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

评论(2

放血 2024-11-07 21:49:00

如果您使用的是 Windows Embedded Compact 7,则可以使用可插入到您正在测试的驱动程序前面的筛选驱动程序。过滤驱动程序可以阻止任何呼叫到达您的驱动程序,从而有效地让您的驱动程序空闲。

过滤器驱动程序是 Compact 7 中的一项新功能,因此如果您使用的是旧版本,它不会对您有帮助。请参阅http://embedded101.com/Articles/ Embedded101Article/tabid/75/ArticleId/28/Filter-Device-Drivers.aspx 了解过滤器驱动程序的介绍。

If you are using Windows Embedded Compact 7, you might be able to use a filter driver which can be inserted in front of the driver you are testing. The filter driver can prevent any calls from reaching your driver, hence effectively leaving your driver idle.

Filter drivers are a new feature in Compact 7, so it will not help you if you are using an older version. See http://embedded101.com/Articles/Embedded101Article/tabid/75/ArticleId/28/Filter-Device-Drivers.aspx for an intro to filter drivers.

埋情葬爱 2024-11-07 21:49:00

我不完全明白。如果您编写了驱动程序,那么您就是 的看门人驱动程序的每个入口点。您可以允许/禁止客户端以您想要的方式调用(例如信号量、互斥体、布尔标志等)。您会知道是否有人正在“使用”该驱动程序,因为也许有人调用了“打开”而不是“关闭”。或者像 Read 或 Write 这样的方法已经进入但尚未退出。

I don't fully understand. If you wrote the driver, you are the gatekeeper to every entry point into the driver. You can allow/disallow clients to call in however you want (e.g. semaphore, mutex, boolean flag, etc). You would know if anyone is "using" the driver because maybe someone called Open and not Close. Or a method like Read or Write would have been entered and not yet exited.

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