What are Native DLLs?

2020-03-09 20:59发布

When I was reading about DLLs on StackOverflow I came accross the word "Native DLLs" a lot of times. I found questions regarding them but I couldn't understand what a "Native DLL" actually is.

What is a native DLL?

标签: dll native
5条回答
Evening l夕情丶
2楼-- · 2020-03-09 21:08

Native DLL's are usually DLL's containing raw processor directly-executable code (such as that found in the Win32 API's) as opposed to, for example, managed (MSIL) which contain code that is consumed and JIT compiled to native processor instructions by a runtime such as the .NET CLR.

In .NET it is also possible to create mixed-mode DLL's that contain both native binary code and managed code.

查看更多
放荡不羁爱自由
3楼-- · 2020-03-09 21:09

The term native DLL was originally used before managed code existed. It was originally intended to refer to DLLs that are not COM DLLs. It is intended to refer to DLLs like the ones in Windows originally.

Note that Kev said "In .NET it is also possible to create mixed-mode DLL's that contain both native binary code and managed code." but that is not relevant; such a DLL is not a native DLL because it has CLI (.Net) metadata. Also, mixed-mode DLL's can only be developed using C++/CLI; no other language supports it.

See my article Native Windows Dynamic Link Libraries (DLLs) for more.

查看更多
We Are One
4楼-- · 2020-03-09 21:12

this term came out when managed code that comes from .net assemblies was invented, to distinguish between managed and unmanaged =native code. every .net assembly gets "nativied" by the JIT-compiler during execution. this means it gets translated to asm code that is "natively" understandable to the CPU.

查看更多
▲ chillily
5楼-- · 2020-03-09 21:21

From what I understand a "Native DLL" will be a basic Win32 dll for example. A DLL that contains non managed code.

With .NET you write Managed assemblies. These will call the base level Windows code which is the same that a non-managed application will call.

查看更多
迷人小祖宗
6楼-- · 2020-03-09 21:26

A quick look through these MSDN search results will answer your question:

http://social.msdn.microsoft.com/Search/en-US?query=define:%20native%20dll&ac=8

It's simple a DLL that contains machine code, rather than MSIL.

查看更多
登录 后发表回答