.dll
Other
DLL(动态链接库)
DLL 是 Windows 共享库格式,包含多个程序同时使用的代码和数据。DLL 支持模块化软件设计,通过代码共享减少内存使用,是 Windows 操作系统和应用生态系统的基础。
MIME 类型
application/vnd.microsoft.portable-executable
类型
二进制
压缩
无损
优点
- + Code sharing — multiple programs use the same DLL in memory
- + Modular updates — patch a DLL without recompiling applications
- + Reduced disk and memory usage through shared libraries
缺点
- − DLL Hell — version conflicts between applications
- − Security risk — malicious DLL injection and sideloading attacks
- − Windows-only — Linux uses .so, macOS uses .dylib
何时使用 .DLL
DLL 由 Windows 应用程序使用;开发者创建它们作为共享库。最终用户不应修改或删除系统 DLL。
技术细节
DLL 文件使用 PE(可移植可执行文件)格式——与 .exe 文件相同的结构,但带有表示其为库的标志。它们通过导出表导出函数和数据,由 Windows 加载器在运行时加载。
历史
Microsoft 在 1985 年的 Windows 1.0 中引入了 DLL,用于在有限内存环境中在应用程序之间共享代码。该格式随 Windows 演变为今天使用的 PE(可移植可执行文件)格式。