用户代理还是守护进程?

发布于 2024-09-08 03:41:36 字数 423 浏览 8 评论 0原文

我正在为 HID 设备编写驱动程序。驱动程序以独占访问模式打开 HID 设备。该驱动程序应该为所有用户运行。所以它应该是用户代理或守护进程。

在驱动程序中,我使用了一些位于 ApplicationService 框架下的 CoreGraphics API,但是 技术说明说守护进程无法访问ApplicationService框架。

所以我可以选择用户代理,但我不知道快速用户切换完成后用户代理的行为是什么。

您能建议我应该朝哪个方向走吗?

问候
Devara Gudda

编辑:CoreGraphics 框架用于发布事件。

I am writing driver to a HID device. The driver opens HID device in exclusive access mode. This driver should run for all user. So it should be either User agent or daemon.

In driver I use some CoreGraphics API's which is under ApplicationService framework but Technote say's daemon won't get access to ApplicationService framework.

So I can go For User Agent , but i don't know what is the behavior of User Agent when Fast User Switching is done.

Could you please suggest in which direction I should go?

Regards
Devara Gudda

Edit: The CoreGraphics framework is used to post Events.

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

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

发布评论

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

评论(1

南风几经秋 2024-09-15 03:41:36

如果您需要 coregraphics 库,则需要完全在用户空间的上下文中并在其环境中运行以提供图像。我不知道您所追求的具体内容,但您也许可以通过在需要时启动应用程序的用户空间组件来玩一些游戏,该组件以某种方式向用户提供图形。

如果您是用户代理,当您切换时,代码仍将运行,但窗口机制不会写入您可以看到的屏幕。如果您只是在幕后创建图像,这可能并不重要。我不记得你的代码是否会被暂停 - 我认为它只是进入“背景”,但还没有研究细节。

问题的核心是您正在使用 CoreGraphics 库做什么以及为什么需要它们。如果您正在为非特定于用户的内容生成背景图像,并且您希望无论用户如何都持续运行,那么也许可以考虑使用不需要窗口系统来完成图形工作的替代图形库(即 libgd或类似的)

If you need the coregraphics libraries, you need to be entirely in the context of user space and running within their environment to provide the images. I don't know the specifics of what you're after, but you might be able to play some games with having a user-space component of the application get launched at need that provides the graphics back to the user in some fashion.

If you're a User Agent, when you get switched that code will still be running but the windowing mechanisms won't be writing to the screens that you can see. If you're just creating images deep under the covers, this may not matter. I don't recall if your code will be paused or not - I think it just goes "background", haven't looked into detail though.

The heart of the matter is what you're doing with the CoreGraphics libraries and why you need them. If you're generating background images for something that aren't user specific and you want to be running constantly regardless of user, then perhaps look into an alternate graphics library that doesn't require the windowing systems to do the graphics work (i.e. libgd or such)

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