谁是剪贴板的系统所有者?

发布于 2024-11-27 00:15:03 字数 334 浏览 1 评论 0原文

在阅读 MSDN 中有关剪贴板的内容时,我遇到了这一行:

将内存对象放入剪贴板后,该对象的所有权 内存句柄被传输到系统。当剪贴板为 清空并且内存对象具有以下剪贴板之一 格式,系统通过调用释放内存对象 指定功能:... (http://msdn.microsoft.com/en-us/library/ms649014%28VS.85%29.aspx - 内存和剪贴板部分)。

我不太明白的是“系统是谁”?系统进程?剪贴板所有者进程???

感谢您的帮助! :-)

While reading about the clipboard in MSDN I came across this line:

After a memory object is placed on the clipboard, ownership of that
memory handle is transferred to the system. When the clipboard is
emptied and the memory object has one of the following clipboard
formats, the system frees the memory object by calling the
specified function: ...
(http://msdn.microsoft.com/en-us/library/ms649014%28VS.85%29.aspx - Memory and the Clipboard section).

What I don't quite understand is "who is the system"? a SYSTEM process? clipboard owner process???

Thanks for your help! :-)

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

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

发布评论

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

评论(2

蓝眼睛不忧郁 2024-12-04 00:15:03

“操作系统”是什么意思?!不存在“操作系统”进程。哪个进程实际上释放了对象?

嗯,有,这个过程叫做“系统”。但这与此无关,每个与剪贴板发生冲突的 Windows 应用程序都会加载 user32.dll。 “系统”。 Kernel32.dll 是每个 Windows 应用程序都会加载的另一个重要文件。 Windows 就很酷,您只需为实际使用的操作系统部分付费。这些 DLL 中的代码所需的内存由每个进程共享。在 Windows NT 必须使用 16 MB 内存启动的时代,这一点非常重要。

不需要单独的过程。

让这些不同的系统 DLL 实例协同工作是 Microsoft 头疼的问题。但这也是防止崩溃进程导致操作系统崩溃的非常策略。

What do you mean "Operating System" ?! There is no "operating system" process. Which process is actually freeing the object?

Well, there is, the process is called "System". But that's not relevant here, every Windows app that messes with the clipboard loads user32.dll. The "system". Kernel32.dll is another important one that every Windows app loads. Windows is pretty cool like that, you only pay for the bits of the operating system that you actually use. And the memory required for the code in those DLLs is shared by every process. That was really important back in the days that Windows NT had to boot with 16 megabytes of memory.

No separate process is required.

Getting these different instances of system DLLs to work together is Microsoft's headache. But it is also a very important strategy to prevent a crashing process from taking down the operating system with it.

郁金香雨 2024-12-04 00:15:03

在文档中提及系统是让您知道它没有准确记录它发生的位置并且可能会发生更改。不要屏住呼吸等待它。系统通常是操作系统[1],它不仅仅是一个< /strong> 过程。它由无数的应用程序组成,这些应用程序在进程中使用动态库,以不同的深度相互通信,范围从较低级别的内核模式到较高级别的用户模式。在所有这一切中的某个地方,剪贴板被处理。

现在,请不要接受这个答案,而是等待汉斯的答案。

[1] 引用 Raymond Chen 的话:“我不敢相信我不得不这么说。”

Saying the system in the documentation is a way of letting you know that it's not documented exactly where it happens and it's subject to change. And Don't Hold Your Breath Waiting For It. The system is generally the operating system [1], which isn't just one process. It's comprised of a gazillion applications that uses dynamic libraries in processes, communicating with each other at different levels of depth, ranging from lower level kernel mode up to higher level user mode. Somewhere in all of that, the clipboard is handled.

Now, please don't accept this answer, but wait for Hans'.

[1] Quoting Raymond Chen: "I can't believe I had to say that."

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