WHAT DO DLL FILES DO CODE
This is necessary because the eventual addresses of the things in the DLL cannot be known before it's been loaded into memory.Ģ) What actually executes the code in the DLL? Does it get executed by methods) in the DLL are replaced with the actual addresses of the things in the DLL. method calls) in the calling code to symbols (e.g. In the case of native DLLs it's a component of the operating system that loads and links the DLL (no compilation is necessary because native DLLs already contain native code).ġb) What is the process of "linking"? Are checks made that there isĬompatibility? Loading into the same memory? What does linkingġb) Linking is when references (e.g. NET bytecode into native code) and links the DLLs. NET framework is what loads, JIT compiles (compiles the. Net framework?ġa) In the case of managed DLLs, the. When something like Word suddenly starts accessing the HDD a lot, it's likely swapping (getting data that has been swapped out to the disk to make room in the RAM)ġa) Additionally what loads and links the DLL - the O/S or some This is why you can get TypeNotFoundExceptions anywhere in your code if a DLL can't be loaded. NET, DLLs are usually loaded on demand when the first method trying to access anything from the DLL is executed. Linking in functionality from other DLL's?ġ) In the case of. Using Word etc and I reckon that this Word going off and dynamically
WHAT DO DLL FILES DO WINDOWS
Notice a lot in Windows HDD thrashing for seemingly small tasks when
NET (managed code) and native code, however managed code DLLs and native DLLs are very different inside.ġ) At what point does web.dll dynamically link to business.dll? You Microsoft decided to go with the same file extensions (.exe and. What is DLL importing and DLL registration?įirst of all, you need to understand the difference between two very different kinds of DLLs. What in my C# program is deciding if I can access another DLL? If my hijacked DLL contained exactly the same methods and types as the original but it was compiled in another language, would it work? I suppose this wouldn't be hard to do if you could find out what methods were available in the original DLL.Ħa. On the subject of DLL hijacking, surely the replacement (bad) DLL must contain the exact method signatures and types as the one that is being hijacked. Same applies for methods can I write a CreateInvoice() method in a DLL, compile it in C++, and then access and run it from C#? What stops or allows me from doing this? If I had compiled my Business.dll file in, say, Delphi: would C# understand it and be able to create a customer class, or is there some sort of header info or something that says "hey sorry you can only use me from another Delphi DLL"?ĥa. This must mean that Business.dll contains some sort of a specification as to what a customer class actually is. Going back to the Web.dll / Business.dll example - to get a class type of customer I need to reference Business.dll from Web.dll. abc is something that it can link into its code. If the answer to 4 is "no" then what is the point of a DLL? Why dont the various frameworks use their own formats for linked files? For example: an. NET be used by a DLL built with, for example, Borland C++?Ĥa. NET framework or the operating system directly?ĭoes a DLL from Linux work on a Windows system (if such a thing exists), or are they operating system specific?Īre DLLs specific to a particular framework? Can a DLL built using C#. What actually executes the code in the DLL? Does it get executed by the processor or is there another stage of translation or compilation before the processor will understand the code inside the DLL?Ģa. What is the process of "linking"? Are compatibility checks made? Loading into the same memory? What does linking actually mean?
Additionally, what loads and links the DLL - the OS or some run time framework such as the. However, consider the following ASP.NET project with Web.dll and Business.dll ( Web.dll is the front end functionality and it references Business.dll for types and methods).Īt what point does Web.dll dynamically link to Business.dll? You notice a lot in Windows HDD thrashing for seemingly small tasks when using Word (etc.) and I reckon that Word is going off and dynamically linking in functionality from other DLLs?ġa. I understand a DLL is a dynamically linked library which means that another program can access this library at run time to get "functionality". This is a sort of brain dump of questions regarding DLLs. I'm always referencing DLLs in my C# code, but they have remained somewhat of a mystery which I would like to clarify.