This is the
talk page for discussing improvements to the
Dynamic-link library article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google ( books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||||||
|
It is requested that a computing diagram or diagrams be
included in this article to
improve its quality. Specific illustrations, plots or diagrams can be requested at the
Graphic Lab. For more information, refer to discussion on this page and/or the listing at Wikipedia:Requested images. |
which places the DLL's location and its globally unique ID (GUID) in the registry. Programs can then use the DLL by looking up its GUID in the registry to find its location.
This is wrong DLLs don't have GUIDs. A DLL can have one or more components inside and those are the ones that have unique GUIDs. For example:
[HKEY_CLASSES_ROOT\CLSID\{00000105-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"
[HKEY_CLASSES_ROOT\CLSID\{00000106-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"
different GUIDs pointing to the same DLL. -- 87.196.95.140 11:05, 22 January 2007 (UTC)
User:67.10.10.66 introduced many small factual errors in his (obviously good-faith) edits, so I decided to revert them and merge the valuable additions gradually.
E.g. DLLs aren't limited to PE files (they were NE in 16-bit Windows); SYS, DRV and FO? have nothing to do with them, except they are also PE; ordinals are mandatory, while names aren't; and so on.
I expect to edit the article further. -- tyomitch 06:55, 28 November 2005 (UTC)
The article still needs information on at least the following points.
There's just one thing called Dynamic-Link Library; no disamb needed disamb, if necessary, should go by some other name. --
tyomitch 09:19, 4 December 2005 (UTC)
Jsmethers 01:16, 6 December 2005 (UTC)
Linux operating system also supports dynamic linked library so that information must be included in this article as well. —Preceding unsigned comment added by Dinesh372 ( talk • contribs) 13:33, 19 November 2009 (UTC)
Does "disabling caching of dll into memory" help and why? I have too little RAM already and need it used as efficiently as possible. And how to do that?
With GCC on Win32, it is possible to write DLLs in the same way that shared objects are written on POSIX systems. For example, consider two files, testlib.h:
#ifndef _TESTLIB_H #define _TESTLIB_H extern int test_func(int a, int b); #endif
And testlib.c:
#include "testlib.h" int test_func(int a, int b) { return (a + b); }
Executing GCC (MinGW) with the following options:
gcc -shared -o testlib.dll testlib.c
Will create a file called "testlib.dll". It can then be linked against any file by including the header "testlib.h" and then passing -L. -ltestlib
. I don't know about dynamic loading, but this works for shared linking just fine.—
Kbolino 01:55, 15 May 2007 (UTC)
Is the info about the drawback called "DLL Hell" needed here?
Reading this section of the article, it seems more like a tutorial on how to create DLL's rather than an explanation of what they are specifically. Isn't this generally not encouraged? -- Gafaddict ( talk) 17:56, 21 February 2008 (UTC)
I'd like to propose what is already effectively the rule here: no linking to web sites that list DLLs to download. I think all of these violate the WP:EL linking rules
We could extend this article with a "What to do if a DLL is missing" section, though that may be a magnet for more DLL download sites. SteveLoughran ( talk) 12:45, 27 June 2008 (UTC)
The definition given for DLL in this article is "DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems". Well, there is at least one more operating system using DLLs that I know of: Symbian. I know a little bit about them, but I feel that adding that information to the article will result in quite a mess, as the article is heavily Window-based. Any suggestions from someone more experienced than me in editing the Wikipedia? Jmpep ( talk) 03:25, 14 November 2008 (UTC)
I wrote a section called the "case against DLLs" because virtually all of the dynamic linking articles written in Wikipedia were written by DLL fanboys. The subject is NOT pat, and deserves a counterpoint, which I have written thoughtfully. I have done so before, and the result was having the section clipped out and thrown away. So here is my simple plea: are we presenting all points of view here, or do the fans of one technique or another get to suppress everyone else's viewpoint? DLLs have introduced a lot of unnecessary problems in computing and deserve at least the simple short section I have added, which contains facts and historical background not present in the rest of the article. —Preceding unsigned comment added by 205.229.50.10 ( talk) 22:05, 15 December 2008 (UTC)
...and this is a response to the immediately preceding section here on the talk page, "DLL fanboys":
The problem here is that Wikipedia is not a platform for your point of view... or for mine. A criticism section (and it's hard to argue that this is not that, given the title) is almost inherently going to contain non- neutral point of view material. Now as I read the guidelines and policies - and I could be wrong - such material is ok, but if and only if (you knew this was coming) you find reliable sources that state that point of view, more or less explicitly. And, of course, cite them.
Better yet, since all WP articles are supposed to present a NPOV, if there is such a criticism section then there should also be an equally well referenced "in favor" section.
As WP:RS says, Wikipedia articles should cover all major and significant-minority views that have been published by reliable sources (emphasis added).
Note that taking a set of facts (no matter how well referenced) and deriving from them non-NPOV conclusions (whether positive or negative)--e.g. criticism--is not sufficient. This is considered to be synthesis, a form of original research. The sources themselves must present the point of view being advanced in the article section.
In any case, it is most definitely not the job of a WP editor to edit articles to include his or her own POV. Accordingly, if no reliable sources are provided for the opinions in this section, I will remove the unsourced material as original research within 30 days. If these opinions are really that well supported you should have no problem finding sources in that time. Of course, someone less forgiving may remove it sooner. In that case I would recommend that you keep working on the sources, and put the section and the references back in after you find them. Jeh ( talk) 08:59, 23 December 2008 (UTC)
Cosmic Engine ( talk) 13:38, 20 May 2009 (UTC) DLL is not Microsoft-Specific. [1]
The article says:
Note that with implicit run-time linking, referred to as load-time dynamic linking by Microsoft, if the linked DLL file cannot be found, Windows will display an error message and fail to load the application. The application developer cannot handle the absence of DLL files linked implicitly by the compile-time linker.
This needs correction. Visual C 6.0 and later allows for Delay-Loaded DLLs, whereby the application can gracefully handle a DLL that is missing at run time. Mitch Ames ( talk) 2009-07-11T09:50:21
Why is it claimed that the magic number of DLLs is 'MZ'? This is incorrect. Allow me to explain...
A DLL, just like a Windows executable (*.exe) is a PE format executable (PE means Portable Executable). As this article says, even OCX and other extensions are the same thing. The difference between a Windows DLL and an .exe (and all other extensions) is only *one* bit which is different in the PE header.
"The distinction between EXE and DLL files is entirely one of semantics. They both use the exact same PE format. The only difference is a single bit that indicates if the file should be treated as an EXE or as a DLL. Even the DLL file extension is artificial." - Matt Pietrek ( http://msdn.microsoft.com/en-us/magazine/cc301805.aspx)
'MZ' is actually the ASCII character representation of the *DOS* header signature found at the very first address of a PE file. When Windows loads a PE (like a DLL), the programmer can get a hModule handle to it. This is simply a (long pointer) void* address which points to the very first address. This happens to be the DOS signature's address also (DOS magic):
typedef struct _IMAGE_DOS_HEADER {
WORD e_magic; //<- Magic number 1st
//... other stuff omitted for clarity
// NOTE: All of this is found in 'winnt.h'
}
This value is *actually* 0x5A4D (dec. 23117). Converted to ASCII, it is 'MZ' (initials of Mark Zbikowski). But this is still NOT the magic number of the PE format executable. The DOS header is from, you guessed it, the old days of DOS. It's actually a valid DOS executable which can let the user know that Windows is needed to run the code: "This program cannot be run in DOS mode..."
So what is the PE magic number? It's actually defined as 0x00004550 (dec. 17744, and called 'IMAGE_NT_SIGNATURE'). Converted to ASCII characters, this is 'PE00'. This is always checked for when PEs are loaded, parsed, manipulated and executed. My own embedded system checks first for the DOS magic, then for the PE magic before it allows anything else to take place. Windows and other operating systems which handle PEs do the same thing, because this avoids some random hunk of memory being treated like a PE executable (which could be a disaster if it somehow worked).
So, the PE magic number actually looks like this, and is found also in 'winnt.h'
#define IMAGE_NT_SIGNATURE 0x00004550 // ASCII "PE00"
Can we have the article changed to give the correct information to readers? Also, please don't post its ASCII character representation. The magic number is hexadecimal (as usual). It just so happens it was chosen for what it stood for in ASCII, but it's just a hex number (like 0x1BADB002 for the GNU multiboot specification). It should be mentioned that it means 'PE00' in ASCII, but that's not considered the magic number. That is just a character string (or char*) which consists of the same 32 bits. —Preceding unsigned comment added by 67.142.163.28 ( talk) 11:43, 17 February 2010 (UTC)
Why do you need anything else than .dll file (function name+function code) and .h file (function name) to use dll? I have heard that on linux you only need .so dynamic library and header file. Is this some name mangling issue? Aquickoverview ( talk) 04:57, 16 March 2010 (UTC)
External References to Microsoft knowledge base in the form of direct links will eventually stop working, because Microsoft frequently rearranges its website in a non-compatible manner. —Preceding unsigned comment added by 86.82.106.129 ( talk) 13:18, 27 December 2010 (UTC)
Suggesting to change the c/cpp example code line from
typedef double (*importFunction)(double, double);
to
typedef double (WINAPI *importFunction)(double, double);
As a source 'suggestion', the MS example at
http://msdn.microsoft.com/en-us/library/ms683212
shows using in that format, by putting the 'WINAPI' in the statement (but not totaly sure what it does yet).
Reason being is that while attempting to learn to use the dll's on dev-c++, I've spent over a day wondering why the static linked function worked, while dynamic linked function crashed the program (after messing the program flow, and partially working). After some time, of looking at another code, it finally worked after adding in the WINAPI word. I'm not sure what other ide's/compilers might require it, but it might be helpful to point it out, to try adding it in into all of the typedef statements. —Preceding unsigned comment added by 76.190.255.231 ( talk) 04:51, 28 December 2010 (UTC)
the "Background for DLL" seems to imply that Microsoft invented the concept of device drivers. Is that true? can someone support/refute that with references? PratikMallya ☎ 23:45, 17 April 2011 (UTC)
What's it mean, "any data file with the same file format can be […]" — "same file format" as what, itself? -- Jerome Potts ( talk) 00:02, 31 March 2013 (UTC)
erwer — Preceding unsigned comment added by 115.113.203.5 ( talk) 10:55, 23 July 2013 (UTC)
On unixoid operating systems I don't need any source code annotations. Why are they necessary on MS Windows? -- RokerHRO ( talk) 13:51, 17 March 2015 (UTC)
Several code examples in the article are prefixed with the warning: "Warning: the following code is vulnerable, it doesn't conform to Microsoft's guidance for safe library loading!", probably referring to " DLL spoofing". Should/could the examples be fixed? – Tea2min ( talk) 08:27, 22 March 2019 (UTC)
The following Wikimedia Commons file used on this page or its Wikidata item has been nominated for speedy deletion:
You can see the reason for deletion at the file description page linked above. — Community Tech bot ( talk) 16:52, 7 September 2022 (UTC)
This is the
talk page for discussing improvements to the
Dynamic-link library article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google ( books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||||||
|
It is requested that a computing diagram or diagrams be
included in this article to
improve its quality. Specific illustrations, plots or diagrams can be requested at the
Graphic Lab. For more information, refer to discussion on this page and/or the listing at Wikipedia:Requested images. |
which places the DLL's location and its globally unique ID (GUID) in the registry. Programs can then use the DLL by looking up its GUID in the registry to find its location.
This is wrong DLLs don't have GUIDs. A DLL can have one or more components inside and those are the ones that have unique GUIDs. For example:
[HKEY_CLASSES_ROOT\CLSID\{00000105-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"
[HKEY_CLASSES_ROOT\CLSID\{00000106-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"
different GUIDs pointing to the same DLL. -- 87.196.95.140 11:05, 22 January 2007 (UTC)
User:67.10.10.66 introduced many small factual errors in his (obviously good-faith) edits, so I decided to revert them and merge the valuable additions gradually.
E.g. DLLs aren't limited to PE files (they were NE in 16-bit Windows); SYS, DRV and FO? have nothing to do with them, except they are also PE; ordinals are mandatory, while names aren't; and so on.
I expect to edit the article further. -- tyomitch 06:55, 28 November 2005 (UTC)
The article still needs information on at least the following points.
There's just one thing called Dynamic-Link Library; no disamb needed disamb, if necessary, should go by some other name. --
tyomitch 09:19, 4 December 2005 (UTC)
Jsmethers 01:16, 6 December 2005 (UTC)
Linux operating system also supports dynamic linked library so that information must be included in this article as well. —Preceding unsigned comment added by Dinesh372 ( talk • contribs) 13:33, 19 November 2009 (UTC)
Does "disabling caching of dll into memory" help and why? I have too little RAM already and need it used as efficiently as possible. And how to do that?
With GCC on Win32, it is possible to write DLLs in the same way that shared objects are written on POSIX systems. For example, consider two files, testlib.h:
#ifndef _TESTLIB_H #define _TESTLIB_H extern int test_func(int a, int b); #endif
And testlib.c:
#include "testlib.h" int test_func(int a, int b) { return (a + b); }
Executing GCC (MinGW) with the following options:
gcc -shared -o testlib.dll testlib.c
Will create a file called "testlib.dll". It can then be linked against any file by including the header "testlib.h" and then passing -L. -ltestlib
. I don't know about dynamic loading, but this works for shared linking just fine.—
Kbolino 01:55, 15 May 2007 (UTC)
Is the info about the drawback called "DLL Hell" needed here?
Reading this section of the article, it seems more like a tutorial on how to create DLL's rather than an explanation of what they are specifically. Isn't this generally not encouraged? -- Gafaddict ( talk) 17:56, 21 February 2008 (UTC)
I'd like to propose what is already effectively the rule here: no linking to web sites that list DLLs to download. I think all of these violate the WP:EL linking rules
We could extend this article with a "What to do if a DLL is missing" section, though that may be a magnet for more DLL download sites. SteveLoughran ( talk) 12:45, 27 June 2008 (UTC)
The definition given for DLL in this article is "DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems". Well, there is at least one more operating system using DLLs that I know of: Symbian. I know a little bit about them, but I feel that adding that information to the article will result in quite a mess, as the article is heavily Window-based. Any suggestions from someone more experienced than me in editing the Wikipedia? Jmpep ( talk) 03:25, 14 November 2008 (UTC)
I wrote a section called the "case against DLLs" because virtually all of the dynamic linking articles written in Wikipedia were written by DLL fanboys. The subject is NOT pat, and deserves a counterpoint, which I have written thoughtfully. I have done so before, and the result was having the section clipped out and thrown away. So here is my simple plea: are we presenting all points of view here, or do the fans of one technique or another get to suppress everyone else's viewpoint? DLLs have introduced a lot of unnecessary problems in computing and deserve at least the simple short section I have added, which contains facts and historical background not present in the rest of the article. —Preceding unsigned comment added by 205.229.50.10 ( talk) 22:05, 15 December 2008 (UTC)
...and this is a response to the immediately preceding section here on the talk page, "DLL fanboys":
The problem here is that Wikipedia is not a platform for your point of view... or for mine. A criticism section (and it's hard to argue that this is not that, given the title) is almost inherently going to contain non- neutral point of view material. Now as I read the guidelines and policies - and I could be wrong - such material is ok, but if and only if (you knew this was coming) you find reliable sources that state that point of view, more or less explicitly. And, of course, cite them.
Better yet, since all WP articles are supposed to present a NPOV, if there is such a criticism section then there should also be an equally well referenced "in favor" section.
As WP:RS says, Wikipedia articles should cover all major and significant-minority views that have been published by reliable sources (emphasis added).
Note that taking a set of facts (no matter how well referenced) and deriving from them non-NPOV conclusions (whether positive or negative)--e.g. criticism--is not sufficient. This is considered to be synthesis, a form of original research. The sources themselves must present the point of view being advanced in the article section.
In any case, it is most definitely not the job of a WP editor to edit articles to include his or her own POV. Accordingly, if no reliable sources are provided for the opinions in this section, I will remove the unsourced material as original research within 30 days. If these opinions are really that well supported you should have no problem finding sources in that time. Of course, someone less forgiving may remove it sooner. In that case I would recommend that you keep working on the sources, and put the section and the references back in after you find them. Jeh ( talk) 08:59, 23 December 2008 (UTC)
Cosmic Engine ( talk) 13:38, 20 May 2009 (UTC) DLL is not Microsoft-Specific. [1]
The article says:
Note that with implicit run-time linking, referred to as load-time dynamic linking by Microsoft, if the linked DLL file cannot be found, Windows will display an error message and fail to load the application. The application developer cannot handle the absence of DLL files linked implicitly by the compile-time linker.
This needs correction. Visual C 6.0 and later allows for Delay-Loaded DLLs, whereby the application can gracefully handle a DLL that is missing at run time. Mitch Ames ( talk) 2009-07-11T09:50:21
Why is it claimed that the magic number of DLLs is 'MZ'? This is incorrect. Allow me to explain...
A DLL, just like a Windows executable (*.exe) is a PE format executable (PE means Portable Executable). As this article says, even OCX and other extensions are the same thing. The difference between a Windows DLL and an .exe (and all other extensions) is only *one* bit which is different in the PE header.
"The distinction between EXE and DLL files is entirely one of semantics. They both use the exact same PE format. The only difference is a single bit that indicates if the file should be treated as an EXE or as a DLL. Even the DLL file extension is artificial." - Matt Pietrek ( http://msdn.microsoft.com/en-us/magazine/cc301805.aspx)
'MZ' is actually the ASCII character representation of the *DOS* header signature found at the very first address of a PE file. When Windows loads a PE (like a DLL), the programmer can get a hModule handle to it. This is simply a (long pointer) void* address which points to the very first address. This happens to be the DOS signature's address also (DOS magic):
typedef struct _IMAGE_DOS_HEADER {
WORD e_magic; //<- Magic number 1st
//... other stuff omitted for clarity
// NOTE: All of this is found in 'winnt.h'
}
This value is *actually* 0x5A4D (dec. 23117). Converted to ASCII, it is 'MZ' (initials of Mark Zbikowski). But this is still NOT the magic number of the PE format executable. The DOS header is from, you guessed it, the old days of DOS. It's actually a valid DOS executable which can let the user know that Windows is needed to run the code: "This program cannot be run in DOS mode..."
So what is the PE magic number? It's actually defined as 0x00004550 (dec. 17744, and called 'IMAGE_NT_SIGNATURE'). Converted to ASCII characters, this is 'PE00'. This is always checked for when PEs are loaded, parsed, manipulated and executed. My own embedded system checks first for the DOS magic, then for the PE magic before it allows anything else to take place. Windows and other operating systems which handle PEs do the same thing, because this avoids some random hunk of memory being treated like a PE executable (which could be a disaster if it somehow worked).
So, the PE magic number actually looks like this, and is found also in 'winnt.h'
#define IMAGE_NT_SIGNATURE 0x00004550 // ASCII "PE00"
Can we have the article changed to give the correct information to readers? Also, please don't post its ASCII character representation. The magic number is hexadecimal (as usual). It just so happens it was chosen for what it stood for in ASCII, but it's just a hex number (like 0x1BADB002 for the GNU multiboot specification). It should be mentioned that it means 'PE00' in ASCII, but that's not considered the magic number. That is just a character string (or char*) which consists of the same 32 bits. —Preceding unsigned comment added by 67.142.163.28 ( talk) 11:43, 17 February 2010 (UTC)
Why do you need anything else than .dll file (function name+function code) and .h file (function name) to use dll? I have heard that on linux you only need .so dynamic library and header file. Is this some name mangling issue? Aquickoverview ( talk) 04:57, 16 March 2010 (UTC)
External References to Microsoft knowledge base in the form of direct links will eventually stop working, because Microsoft frequently rearranges its website in a non-compatible manner. —Preceding unsigned comment added by 86.82.106.129 ( talk) 13:18, 27 December 2010 (UTC)
Suggesting to change the c/cpp example code line from
typedef double (*importFunction)(double, double);
to
typedef double (WINAPI *importFunction)(double, double);
As a source 'suggestion', the MS example at
http://msdn.microsoft.com/en-us/library/ms683212
shows using in that format, by putting the 'WINAPI' in the statement (but not totaly sure what it does yet).
Reason being is that while attempting to learn to use the dll's on dev-c++, I've spent over a day wondering why the static linked function worked, while dynamic linked function crashed the program (after messing the program flow, and partially working). After some time, of looking at another code, it finally worked after adding in the WINAPI word. I'm not sure what other ide's/compilers might require it, but it might be helpful to point it out, to try adding it in into all of the typedef statements. —Preceding unsigned comment added by 76.190.255.231 ( talk) 04:51, 28 December 2010 (UTC)
the "Background for DLL" seems to imply that Microsoft invented the concept of device drivers. Is that true? can someone support/refute that with references? PratikMallya ☎ 23:45, 17 April 2011 (UTC)
What's it mean, "any data file with the same file format can be […]" — "same file format" as what, itself? -- Jerome Potts ( talk) 00:02, 31 March 2013 (UTC)
erwer — Preceding unsigned comment added by 115.113.203.5 ( talk) 10:55, 23 July 2013 (UTC)
On unixoid operating systems I don't need any source code annotations. Why are they necessary on MS Windows? -- RokerHRO ( talk) 13:51, 17 March 2015 (UTC)
Several code examples in the article are prefixed with the warning: "Warning: the following code is vulnerable, it doesn't conform to Microsoft's guidance for safe library loading!", probably referring to " DLL spoofing". Should/could the examples be fixed? – Tea2min ( talk) 08:27, 22 March 2019 (UTC)
The following Wikimedia Commons file used on this page or its Wikidata item has been nominated for speedy deletion:
You can see the reason for deletion at the file description page linked above. — Community Tech bot ( talk) 16:52, 7 September 2022 (UTC)