如何利用WinUsb实现多个应用程序并发访问

发布于 2024-09-29 23:13:22 字数 346 浏览 1 评论 0原文

我们正在移植 USB 设备 dll 以使用通用 WinUsb。 然而,WinUsb不支持多个并发应用程序访问同一设备(相同的VID和PID)。 我想知道是否有办法使用WinUsb实现这种并发访问? 我读到了有关过滤器驱动程序和过滤器驱动程序的信息。服务。 1. 我不想使用过滤器驱动程序,因为据我了解,这必须通过 WHQL,而我宁愿不走这条路。 2.关于windows服务:我到底应该如何实现它?该服务是否应该获得对 WinUsb 的所有调用,并且如果不同的应用程序尝试访问同一设备,它将关闭与第一个应用程序的连接,打开一个新连接,然后再次返回?

在这种情况下,该服务是正确的解决方案吗?除了我写的之外,还有其他方法可以实现该解决方案吗?

谢谢。

We're porting our USB device dll's to use the generic WinUsb.
However, WinUsb doesn't support multiple concurrent application accss to the same device (Same VID & PID).
I wanted to know if there is a way to implement this concurrent access using WinUsb?
I read about filter drivers & services.
1. I don't want to use a filter driver because, as I understand, this will have to pass WHQL, and I rather not go this path.
2. Regarding a windows service: How exactly should I implement it? should the service get all of the calls to WinUsb, and if a different application tries to access the same device, it will close the connection to the first application, open a new connection, and back again?

Is the service the right correct solution in this case? Is there another way to implement the solution other that what I wrote?

Thanks.

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

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

发布评论

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

评论(1

梦过后 2024-10-06 23:13:22

过滤器驱动程序不需要通过 WHQL。您只需签署驱动程序包所需的目录文件。这只需要来自 verising/... 的代码签名证书。 应该是了解这一点的一个很好的起点。

然而,内核驱动程序可能很难开发。所以也许 COM 服务器是更好的方法。您可以通过服务实现这种共享,方法是允许 COM 客户端从您的服务创建对象,然后在 COM 服务器中实现某种共享/互斥。

COM-exe 服务器的编写速度相对较快。

A filter driver does not need to pass WHQL. You only need to sign the catalog file, needed by the driver package. This only needs a code signing certigficate from verising/... . This should be a good starting place to get to know this.

Nevertheless, a kernel driver can be hard to develop. So maybe a COM server would be a better approach. You implement this sharing from a service, by allowing COM-clients to create objects from your service and then implement some kind of sharing/mutual exclusion in your COM-server.

A COM-exe servers can be written relativly fast.

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