Dynamic-link library (Windows)
m (→Sample files) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
|extensions={{ext|dll}}, {{ext|ocx}}, {{ext|drv}} | |extensions={{ext|dll}}, {{ext|ocx}}, {{ext|drv}} | ||
}} | }} | ||
− | A '''dynamic-link library''' (DLL) is a Microsoft Windows method of having separately-compiled modular routines able to be loaded at run-time when needed by programs. The various versions of Windows include a large number of such files used by system programs and other software, and third-party software is likely to include other files of this sort, some specific to one program and some shared by multiple programs. | + | A '''dynamic-link library''' ('''DLL''') is a particular kind of [[New Executable|NE]] or [[Portable Executable|PE]] file. It is a Microsoft Windows method of having separately-compiled modular routines able to be loaded at run-time when needed by programs. The various versions of Windows include a large number of such files used by system programs and other software, and third-party software is likely to include other files of this sort, some specific to one program and some shared by multiple programs. |
+ | The normal file extension is .dll, but .ocx is also found for libraries containing [[ActiveX]] controls, and .drv for system drivers (of an old legacy format). Additionally, some other formats such as [[FON]] use similar format, but limited to particular sorts of content rather than the full range of executable program routines and resource data which can be stored in a DLL. | ||
+ | |||
+ | == Discussion == | ||
There are lots of problems and pitfalls related to these files. Programs may install different versions of the same DLL on top of the previously existing one, possibly breaking other software that depends on the other version and is incompatible with the one just installed. Or if a program's installer avoids this problem by installing its DLLs in a different directory from others of the same name (which might be different versions of a DLL or totally different ones that just happened to be named the same), a system might still have a poorly-set path variable that causes the wrong version to be used, and trying to untangle which file is supposed to be used by which program is a difficult task even for a technically knowledgeable user. Then when you uninstall a program, perhaps it will delete all its DLLs (perhaps breaking a different program that also uses them), or perhaps it will leave them in place (even if no other program uses them), contributing to the mess and bloat that plagues Windows PCs in their old age. | There are lots of problems and pitfalls related to these files. Programs may install different versions of the same DLL on top of the previously existing one, possibly breaking other software that depends on the other version and is incompatible with the one just installed. Or if a program's installer avoids this problem by installing its DLLs in a different directory from others of the same name (which might be different versions of a DLL or totally different ones that just happened to be named the same), a system might still have a poorly-set path variable that causes the wrong version to be used, and trying to untangle which file is supposed to be used by which program is a difficult task even for a technically knowledgeable user. Then when you uninstall a program, perhaps it will delete all its DLLs (perhaps breaking a different program that also uses them), or perhaps it will leave them in place (even if no other program uses them), contributing to the mess and bloat that plagues Windows PCs in their old age. | ||
If a program crashes due to lack of a required DLL, perhaps you'll Google it and run into a site that purports to make it available for download... but then tries to push you into downloading and installing their own spyware/adware as well. Watch out! You're best going to the appropriate software manufacturer's site (e.g., Microsoft's if it's a part of the Windows system, or the third-party software company for the package that the DLL is connected with). | If a program crashes due to lack of a required DLL, perhaps you'll Google it and run into a site that purports to make it available for download... but then tries to push you into downloading and installing their own spyware/adware as well. Watch out! You're best going to the appropriate software manufacturer's site (e.g., Microsoft's if it's a part of the Windows system, or the third-party software company for the package that the DLL is connected with). | ||
− | == | + | == Identification == |
− | + | === NE === | |
+ | The byte at offset 13 of the extended header is a field named ''Application Flags''. For NE DLL files, it has the 0x80 bit set. | ||
− | + | Refer to [[New Executable#Identification]] for identification of NE format. | |
+ | |||
+ | Note that this identification logic may not be perfect, depending on your definition of what is and is not a DLL (e.g. is a device driver, or an [[Icon library]], a DLL?). | ||
+ | |||
+ | === PE === | ||
+ | The 16-bit integer at offset 22 of the extended header (or, offset 18 of the ''COFF File Header'') is a field named ''Characteristics''. For PE DLL files, it has the 0x2000 bit set. | ||
+ | |||
+ | Refer to [[Portable Executable#Identification]] for identification of PE format. | ||
== Specifications == | == Specifications == | ||
− | + | Refer to [[New Executable]] and [[Portable Executable]]. | |
+ | |||
+ | == Sample files == | ||
+ | * {{DexvertSamples|executable/dll}} | ||
== Links == | == Links == | ||
Line 25: | Line 39: | ||
* [http://www.tutorialspoint.com/dll/ DLL tutorial] | * [http://www.tutorialspoint.com/dll/ DLL tutorial] | ||
* [https://en.wikibooks.org/wiki/Windows_Programming/Dynamic_Link_Libraries Wikibooks: Programming Dynamic Link Libraries] | * [https://en.wikibooks.org/wiki/Windows_Programming/Dynamic_Link_Libraries Wikibooks: Programming Dynamic Link Libraries] | ||
+ | * [https://www.youtube.com/watch?v=JPQWQfDhICA Everything You Ever Wanted to Know about DLLs] (video) | ||
[[Category:Microsoft]] | [[Category:Microsoft]] | ||
+ | [[Category:Windows]] |
Latest revision as of 20:57, 28 December 2023
A dynamic-link library (DLL) is a particular kind of NE or PE file. It is a Microsoft Windows method of having separately-compiled modular routines able to be loaded at run-time when needed by programs. The various versions of Windows include a large number of such files used by system programs and other software, and third-party software is likely to include other files of this sort, some specific to one program and some shared by multiple programs.
The normal file extension is .dll, but .ocx is also found for libraries containing ActiveX controls, and .drv for system drivers (of an old legacy format). Additionally, some other formats such as FON use similar format, but limited to particular sorts of content rather than the full range of executable program routines and resource data which can be stored in a DLL.
Contents |
[edit] Discussion
There are lots of problems and pitfalls related to these files. Programs may install different versions of the same DLL on top of the previously existing one, possibly breaking other software that depends on the other version and is incompatible with the one just installed. Or if a program's installer avoids this problem by installing its DLLs in a different directory from others of the same name (which might be different versions of a DLL or totally different ones that just happened to be named the same), a system might still have a poorly-set path variable that causes the wrong version to be used, and trying to untangle which file is supposed to be used by which program is a difficult task even for a technically knowledgeable user. Then when you uninstall a program, perhaps it will delete all its DLLs (perhaps breaking a different program that also uses them), or perhaps it will leave them in place (even if no other program uses them), contributing to the mess and bloat that plagues Windows PCs in their old age.
If a program crashes due to lack of a required DLL, perhaps you'll Google it and run into a site that purports to make it available for download... but then tries to push you into downloading and installing their own spyware/adware as well. Watch out! You're best going to the appropriate software manufacturer's site (e.g., Microsoft's if it's a part of the Windows system, or the third-party software company for the package that the DLL is connected with).
[edit] Identification
[edit] NE
The byte at offset 13 of the extended header is a field named Application Flags. For NE DLL files, it has the 0x80 bit set.
Refer to New Executable#Identification for identification of NE format.
Note that this identification logic may not be perfect, depending on your definition of what is and is not a DLL (e.g. is a device driver, or an Icon library, a DLL?).
[edit] PE
The 16-bit integer at offset 22 of the extended header (or, offset 18 of the COFF File Header) is a field named Characteristics. For PE DLL files, it has the 0x2000 bit set.
Refer to Portable Executable#Identification for identification of PE format.
[edit] Specifications
Refer to New Executable and Portable Executable.