.NET mscorlib.dll and Kernel32.dll relation
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 hav开发者_如何转开发e 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.
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
, and gdi32.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 in kernel32.dll
.
.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.
精彩评论