开发者

Which clients are using a driver?

开发者 https://www.devze.com 2023-02-24 10:23 出处:网络
I need one of the drivers to be idle (loaded on the device, but not being us开发者_如何学Pythoned at all) to get some statistics. I need to make sure that no threads/clients are using the driver. I am

I need one of the drivers to be idle (loaded on the device, but not being us开发者_如何学Pythoned 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.


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.


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.

0

精彩评论

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