.NET mscorlib.dll 和 Kernel32.dll 关系
据我了解,需要输入/输出功能的应用程序必须与 Kernel32.dll 通信,而 Kernel32.dll 又将请求发送到内核本身。然而,在 .NET 中,位于 mscorlib.dll 中的控制台类与任何其他应用程序一样,不会直接与内核对话,对吗? mscorlib.dll 是否必须将其请求发送到 Kernel32.dll,或者 .NET 是否具有绕过它的特权?
有谁对它的工作原理有深入的了解吗?
谢谢。
As far as I understand it, applications that want input/output functionalities must speak to the Kernel32.dll which in turns sends the request on to the kernel itself. In .NET however, the console class, located in the mscorlib.dll, like any other application, doesn't directly talk to the kernel, correct? Does mscorlib.dll have to send it's request to the Kernel32.dll or does .NET have special privilege to bypass it?
Does anyone have in dept knowledge on how it works?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所有 .NET 库都会调用本机 Win32 API,包括三个著名库中的 API:
kernel32.dll
、user32.dll
和>gdi32.dll
,为了让事情发生。这几乎是在 Windows 上完成任务的唯一方法。 .NET Framework 是 Windows 之上的一个简单的运行时环境,尽管它是一个非常彻底的环境。mscorlib.dll
提供的功能也不例外。它确实调用了本机 Win32 API 函数,包括在 kernel32.dll 中找到的函数。All of the .NET libraries call down to the native Win32 APIs, including those found in the three well-known libraries,
kernel32.dll
,user32.dll
, andgdi32.dll
, in order to make things happen. This is pretty much the only way to get things done on Windows. The .NET Framework is a simply run-time environment on top of Windows, albeit a very thorough one.The functionality provided by
mscorlib.dll
is no exception here. It indeed invokes the native Win32 API functions, including those found inkernel32.dll
..net本身是一个调用底层系统调用的本机应用程序。因此,当您调用 console.writeline 时,您正在调用 写入控制台。
.net it self is a native application which calls underlying system calls. So when you call console.writeline you are calling a wrapper in effect of writeconsole.