Fact-checked by Grok 2 weeks ago

Dynamic-link library

A dynamic-link library (DLL) is a module that contains functions and data that can be used by another module, such as an application or another DLL, enabling dynamic loading and linking at runtime in Microsoft Windows operating systems. DLLs promote code modularity by allowing developers to separate reusable components from the main application, facilitating easier maintenance, updates, and distribution of shared functionality without recompiling the entire program. They reduce system memory usage through code sharing, where multiple applications can load the same DLL instance into memory simultaneously, conserving resources compared to static linking where each application includes its own copy of the code. The Windows API itself is implemented as a collection of DLLs, such as kernel32.dll for core system services, user32.dll for functions, and gdi32.dll for graphics operations, making them essential for native Windows development. DLLs support both explicit and implicit linking: implicit linking resolves dependencies at via import libraries, while explicit linking uses runtime functions like LoadLibrary and GetProcAddress for on-demand loading, offering flexibility for plugins and conditional code execution. DLLs were first introduced with in November 1985 and subsequently adopted in version 1.0 in December 1987 during the joint Microsoft-IBM development, evolving into a cornerstone of Windows architecture by the 1990s.

Introduction

Definition and Purpose

A (DLL) is a modular that contains code, data, and resources, enabling multiple programs to access and share the same functions and elements simultaneously without embedding duplicates in each application's binary. This design promotes efficiency by treating the DLL as a reusable component within the Windows operating system ecosystem. The primary purposes of DLLs revolve around enhancing and performance: they facilitate code reusability by allowing developers to centralize common functionalities in a single library, thereby reducing the overall size of files; they support centralized updates, where modifications to the shared propagate across all dependent applications without recompiling them; and they improve memory efficiency by loading the library once into a shared , where it can be accessed by multiple processes concurrently. DLLs exhibit key characteristics that distinguish them as runtime-loadable modules, including at application startup or during execution rather than at , which enables late binding and greater in program design. Unlike static libraries, which integrate code directly into the during linking, DLLs defer resolution until , allowing for more adaptable and resource-efficient software architectures.

History and Development

The origins of dynamic-link libraries (DLLs) trace back to the development of , a collaborative operating system between and . OS/2 1.0, released in December 1987, introduced dynamic linking as a core feature, allowing programs to share code and resources at through dynamic-link libraries, which supported multi-threading and modular application design in a 16-bit protected-mode environment. This concept laid the groundwork for shared libraries in subsequent Microsoft systems. DLLs were then formalized in the Windows ecosystem with the release of on May 22, 1990, where they served 16-bit applications by enabling code reusability and reducing memory usage through , marking a shift from static linking prevalent in earlier Windows versions. In Windows 3.0, DLL exports were handled via segmented addressing, with functions resolved at load time to support the growing complexity of graphical user interfaces. The evolution advanced significantly with the advent of in , released in July 1993, which adopted the (PE) file format for both executables and DLLs. This format enabled true shared libraries by providing a structured layout for imports, exports, and relocations, facilitating efficient memory mapping and in a multiprocessor environment. The PE format's design, derived from the Common Object File Format (COFF), allowed DLLs to be loaded as shared sections across processes, addressing limitations of 16-bit DLLs and supporting the NT kernel's emphasis on stability and security. During the mid-1990s, DLLs became integral to the (COM), introduced in 1993 as part of OLE 2.0, where they housed implementation code for reusable, language-agnostic objects, promoting object-oriented extensibility in applications like . Key milestones in the 2000s addressed versioning and compatibility challenges known as "." Windows , launched in October 2001, introduced side-by-side () assemblies, permitting multiple DLL versions to coexist in isolated directories via XML manifest files, which specified dependencies and resolved conflicts without overwriting system files. This mechanism, stored in the WinSxS folder, enhanced application reliability by activating specific assembly versions at runtime. , released in January 2007, built on this with refined manifest handling, including embedded manifests for better compatibility shimming and support for trusted libraries through and (UAC) integration, reducing unauthorized DLL substitutions. Released on April 25, 2005, extended DLL support to 64-bit architectures, requiring separate 64-bit DLLs for native applications while maintaining emulation for 32-bit compatibility, thus broadening hardware utilization on AMD64 processors. In modern contexts, DLLs retain relevance in (UWP) applications introduced with in July 2015. UWP apps package DLLs within .appx or .msix bundles, ensuring self-contained deployment, sandboxing, and automatic versioning without global system impacts, aligning with the shift toward app store distribution and cross-device consistency. In , released in 2021, DLLs continue to support legacy Win32 applications, with enhanced through features like Virtualization-Based Security (VBS), though encourages migration to packaged formats like MSIX for new development. This packaging model isolates dependencies, mitigating traditional DLL conflicts while supporting native Win32 DLLs through extensions like the Desktop Bridge.

Core Mechanics

Dynamic vs. Static Linking

In static linking, the from files is copied directly into the during the build process, creating a self-contained that includes all required functionality. This method eliminates the need for external files at , ensuring the program operates without dependencies on shared components. As a result, statically linked s are more portable and less prone to issues arising from missing or altered libraries, but they tend to be larger in size due to the inclusion of if the same is used across multiple applications. Dynamic linking, by comparison, postpones the incorporation of library code until execution time. Instead of embedding the code, the executable stores references (imports) to functions in external dynamic-link libraries (DLLs), which the operating system loads into and binds to the program as needed. This enables multiple processes to share a single instance of a DLL, conserving and allowing for smaller sizes, while also permitting libraries to be updated independently of applications. However, it introduces overhead for loading and , and potential compatibility issues if DLL versions mismatch across components. Static linking prioritizes reliability and simplicity in deployment by avoiding external dependencies, though it can lead to and complicates library maintenance, as updates require recompiling dependent programs. Dynamic linking offers modularity, reusability, and easier versioning—facilitating system-wide updates without rebuilding executables—but risks "," where conflicting library versions disrupt functionality, and demands careful management of dependencies. Overall, static linking suits scenarios requiring isolation, such as embedded systems, while dynamic linking is preferred for shared environments like Windows applications to optimize resource use. In the Windows operating system, dynamic linking is initiated by the loader subsystem, which parses the executable's import table, maps required DLLs into the process's , and resolves symbolic references. The ntdll.dll module provides the native layer for these operations, exporting low-level functions like LdrLoadDll that the loader uses to handle DLL loading, dependency resolution, and binding without direct user intervention.

Loading Process

The loading process of a dynamic-link library (DLL) in Windows begins during application initialization or upon an explicit call to the LoadLibrary function, where the operating system's loader, primarily handled by components such as ntdll.dll and kernel32.dll, maps the DLL file from disk into the of the calling process. This mapping occurs by reading the DLL's (PE) format file, starting with the header to locate the PE header, which provides essential metadata including the preferred base address, section alignments, and directories for imports and exports. Once the PE file is opened, the loader performs dependency resolution by recursively examining the import table in the PE data directories to identify and load any required dependent DLLs before proceeding with the primary DLL. For instance, system DLLs like kernel32.dll are typically loaded first in the dependency chain to ensure foundational APIs are available, with the loader searching for these dependencies according to the standard DLL search order, which includes the application's directory, the current , the system directory, the 16-bit system directory, the Windows directory, and the directories listed in the . This recursive process continues until all dependencies are resolved and loaded, preventing circular dependencies through built-in checks in the loader. After dependencies are loaded, the DLL is allocated into the process's , with the read-only sections—such as code and constant —mapped as shared pages across processes to promote , while writable segments like the section are allocated privately per to avoid conflicts. If the preferred base address specified in the PE optional header is unavailable due to address space fragmentation or conflicts with other modules, the loader applies relocations from the DLL's .reloc section to adjust internal pointers to the actual loaded address, ensuring compatibility without requiring recompilation. The PE headers' export table is parsed to make the DLL's functions accessible, though actual occurs later. Upon successful loading, the loader invokes the DLL's , DllMain, with the DLL_PROCESS_ATTACH reason code to allow initialization, and returns an HMODULE representing the base address of the loaded module to the caller. If the loading fails—due to reasons such as file not found, access denied, or unresolved dependencies—the function returns NULL, and the caller can retrieve detailed error information via GetLastError. This mechanism differs from static linking, where libraries are incorporated directly into the executable at without loading.

Symbol Resolution and Binding

In the Windows Portable Executable (PE) format, an executable file maintains an import table that enumerates the external symbols—such as functions and —it requires from dynamic-link libraries (DLLs), leaving these references initially unresolved to enable dynamic linking. Conversely, each DLL includes an export table that catalogs the symbols it provides for import by other modules, specifying their names, ordinals, and relative virtual addresses (RVAs). This structure allows the operating system loader to match imports against exports during the loading process, facilitating modular code sharing without embedding full copies of library code in every executable. The Windows PE loader performs symbol resolution by first mapping all dependent DLLs into the process , then traversing the import table to locate corresponding entries in each DLL's export table. For efficiency, the loader uses hint tables generated during the linking phase; these provide suggested ordinal values or name prefixes to accelerate the search through potentially large export directories, avoiding exhaustive linear scans. Resolution can occur by name, where the full symbol string is compared, or by ordinal, a numeric identifier that enables faster lookup but requires precise matching to avoid errors if ordinals change between DLL versions. Once matched, the loader updates the —a runtime-modifiable array in the —with the actual addresses of the exported symbols, effectively binding them for subsequent calls. Binding in DLL symbol resolution typically happens as early binding at load time, the default mechanism where the PE loader resolves and fixes all imports before transferring control to the executable's , ensuring immediate availability of library functions. This contrasts with late binding, performed at runtime on demand, often via explicit calls to functions like LoadLibrary and GetProcAddress, which defer resolution until a specific is first accessed and allow for conditional or version-specific loading. Early binding optimizes startup performance by precomputing addresses but can introduce overhead if unused imports are resolved unnecessarily. To mitigate potential address conflicts during binding—where multiple DLLs claim the same preferred base address in space—rebasing relocates DLL images to non-overlapping locations using relocation tables in the PE format. The REBASE tool from the suite scans and adjusts base addresses in DLLs to prevent such collisions, reducing load-time relocation fixes that could otherwise degrade performance. Although (ASLR) has diminished the need for manual rebasing by randomizing load addresses, it remains relevant for legacy or non-ASLR-aware modules. For finer control over binding timing, the Microsoft Visual C++ (MSVC) linker supports delayed through the /DELAYLOAD flag, which specifies DLLs to load only upon the first invocation of their functions, rather than at process startup. This injects helper code that intercepts import calls, performs on-demand resolution via the IAT, and supports optional unloading to conserve memory for infrequently used libraries. Delayed binding enhances startup speed and resource efficiency, particularly in large applications with optional dependencies, while still leveraging the standard export-import matching process.

Implementation Details

Import Libraries

Import libraries are static library files, typically with a .lib extension, that serve as stubs containing symbol definitions and for functions and exported by a dynamic-link library (DLL). These stubs allow the linker to resolve references during compilation without embedding the actual DLL code, instead generating import thunks—short code sequences that facilitate calls to the DLL's exports via the Import Address Table (IAT) in the executable. The IAT entries are populated at runtime when the operating system loads the DLL and binds the actual function addresses. In the build process, the and linker reference the to validate symbol signatures, perform type checking, and support development tools like IntelliSense, all without needing the DLL file present. This results in an with IAT entries pointing to the DLL's exports, while the DLL provides the implementation; if the DLL is unavailable at load time, the application fails to start. Such preparation ensures efficient compile-time development while deferring full resolution to . These libraries are created using the LIB utility, often from a module-definition (.def) file that enumerates the DLL's exports, via the /DEF option, which also generates an accompanying export file (.exp) for the DLL build. Applications can handle missing DLL functions gracefully through delay-loading mechanisms where imports are resolved only on first use. Unlike export files, which define what a DLL exposes during its own build, import libraries are distributed to consumers for linking against the DLL's .

Explicit Runtime Linking

Explicit runtime linking enables applications to programmatically load dynamic-link libraries (DLLs) and retrieve the addresses of their exported functions during execution, providing greater control compared to implicit linking mechanisms. This approach, also referred to as run-time dynamic linking, is facilitated by key functions that allow developers to manage DLL loading and unloading explicitly. Introduced as part of the , it supports flexible integration of DLLs without requiring them to be resolved at load time. The process begins with calling LoadLibrary or LoadLibraryEx to load the DLL into the process's , which returns a handle of type HMODULE if successful; this handle serves as a to the loaded module and increments its reference count. Developers then use GetProcAddress with the HMODULE and the name (or ordinal) of an exported function to obtain a pointer to that function, which is cast to the appropriate type for invocation. Once the DLL is no longer needed, FreeLibrary is invoked with the HMODULE to decrement the reference count and unload the module if the count reaches zero. If a full path is not provided to LoadLibrary, the system searches for the DLL according to the safe DLL search order (enabled by default since ), which includes mechanisms such as DLL redirection, API sets, side-by-side manifest redirection, the loaded modules list, known DLLs, and (as of version 21H2) the package dependency graph, followed by the application directory, the system directory (such as C:\Windows\System32), the 16-bit system directory, the Windows directory, the current , and finally the PATH . This order prioritizes secure locations to reduce risks like DLL hijacking. Common use cases for explicit runtime linking include conditional loading, where an application can detect and handle missing DLLs by providing alternatives or prompting the user, plugin systems that dynamically load extension modules for extensibility, and scenarios where startup dependencies must be avoided to improve launch or . Unlike implicit linking through libraries, which resolves symbols automatically at startup, explicit linking allows runtime decisions on whether and how to use a DLL. Error handling is essential in this process, as LoadLibrary returns NULL on failure, at which point GetLastError should be called to retrieve the specific error code; for instance, error code 126 (ERROR_MOD_NOT_FOUND) indicates that the specified module could not be located. Similarly, GetProcAddress returns if the function is not found in the DLL, with GetLastError providing details such as error code 127 (ERROR_PROC_NOT_FOUND). These diagnostics enable robust application behavior in the face of loading issues.

Delayed Loading

Delayed loading is a in Visual Studio's C++ that defers the loading of dynamic-link libraries (DLLs) until the first call to a within them, rather than at application startup. This is achieved through the linker flag /DELAYLOAD, which generates functions (thunks) for the imported symbols; these proxies invoke the functions LoadLibrary and GetProcAddress only when the is first accessed. The primary benefit of delayed loading is improved application startup time, as it avoids loading DLLs that may never be used during execution, thereby reducing initial and initialization overhead. If a delayed DLL is not referenced, it is entirely ignored, and with the optional /DELAY:UNLOAD flag, the DLL can be automatically unloaded once no longer needed, further optimizing usage. Implementation relies on the Delay Load Helper library (delayimp.lib), which provides the runtime function __delayLoadHelper2 to handle the loading process. This helper checks if the DLL is already loaded, performs the load if necessary, resolves the function address, and manages error handling; developers can customize this behavior by overriding the helper or providing a custom import address table. This feature was introduced in 6.0, released in 1998, as a significant enhancement for managing DLL dependencies in larger applications. However, delayed loading introduces a small performance overhead on the first call to a in the DLL due to the loading and steps, and it is not ideal for DLLs that contain critical initialization code or are required immediately at startup.

Advantages

Modularity and Reusability

Dynamic-link libraries (DLLs) enable modularity by encapsulating specific functionalities, such as user interface controls or algorithms, into separate modules that can be developed, tested, and maintained independently from the main application. This separation allows developers to focus on discrete components without affecting the entire program, facilitating larger-scale software projects that incorporate multiple language modules or third-party contributions. Reusability is a core benefit of DLLs, as a single library can be shared across multiple executable files (EXEs), eliminating code duplication and promoting efficient resource utilization. For instance, user32.dll provides essential functions for elements like windows and menus, which are invoked by numerous applications simultaneously, thereby standardizing common operations without redundant implementation in each program. The shared loading mechanism of DLLs further enhances efficiency by minimizing disk space requirements and reducing in environments with multiple running applications, as the operating system loads the library once and maps it into each process's . This approach not only conserves resources but also supports architectures, where applications dynamically load DLL-based extensions to add features without recompiling the core software, as demonstrated in extensible systems like those using virtual interface pointers for integration.

Upgradability and Versioning

One key advantage of dynamic-link libraries (DLLs) is their upgradability, which enables developers to update shared code by simply replacing the DLL file on the system without requiring recompilation or relinking of dependent applications. This process leverages the mechanism, where the operating system loader resolves exports at , allowing seamless substitution of the as long as the remains compatible. Since DLLs are typically shared across multiple applications and users on the same system, such updates can have a global effect, propagating improvements, bug fixes, or patches to all consumers simultaneously. Versioning in DLLs presents challenges primarily centered on maintaining to prevent disruptions in existing applications. Developers must ensure consistency in exported functions, data structures, and behaviors across versions, often by adhering to rules such as not altering the ordinal or name of existing exports and avoiding changes to their signatures. To address these issues, manifests—XML files embedded in or accompanying the DLL—facilitate side-by-side deployment, allowing multiple versions of the same DLL to coexist on the , with applications to specific versions via app-local copies placed in the application's rather than relying on system-wide installations. Windows Installer has supported DLL versioning through side-by-side assembly management since , enabling installers to deploy and activate specific s without overwriting others. This capability is extended in .NET assemblies via strong naming, which assigns a unique identity to each using its name, number, public , and optional , ensuring precise binding and preventing version conflicts during updates. To mitigate versioning conflicts further, strategies such as allow COM components within DLLs to be activated without registry entries, using manifests to specify dependencies and versions locally. Similarly, private assemblies in confine DLLs to the application's scope, avoiding interference with system-wide versions and enabling isolated updates. Features such as (introduced in 2009 with ) and Windows Defender Application Control (introduced in 2017 with ) enhance secure replacements by enforcing policies on DLL execution, such as requiring digital signatures or publisher verification to block unauthorized or tampered updates during deployment.

Limitations and Challenges

DLL Hell

DLL Hell refers to a set of complications in Microsoft Windows systems where multiple applications depend on different versions of the same dynamic-link library (DLL), resulting in conflicts when one application's installer overwrites the shared DLL in the system directory, causing other applications to crash or behave unexpectedly due to incompatibility. This issue arose primarily because DLLs were globally registered and stored in a common system folder, such as \Windows\System32 or \Windows\System, with no built-in mechanism for version-specific isolation or rollback, allowing newer installations to replace older files without ensuring backward compatibility. In pre-Windows XP environments, the operating system loaded only the single available version of a DLL for all processes, exacerbating the risk of system-wide failures from even minor updates. The phenomenon was especially acute during the era in the , when consumer-oriented operating systems like and 98 lacked robust file protection, leading to widespread instability as users installed multiple applications that shared common runtime libraries, such as Visual Basic controls or C++ redistributables. For instance, the installation of in 1997 often overwrote critical system DLLs like comctl32.dll, disrupting applications that depended on prior versions and contributing to broader user complaints about software reliability. The term "" was coined in January 1998 by technology columnist Brian Livingston in a critique of Windows 98's ongoing dependency issues, highlighting how such conflicts turned routine software updates into sources of frustration and data loss. Although Microsoft introduced partial mitigations like System File Protection in Windows 98 Second Edition (1999) to safeguard core DLLs, the core problem persisted until (2001) implemented side-by-side assemblies for version coexistence. As of 2025, DLL Hell has been largely resolved in contemporary Windows versions through advanced assembly management and the in .NET, but it continues to affect legacy systems running unpatched or environments, where maintaining compatible DLL versions remains challenging without modern tools. Solutions involving improved versioning and have since become standard, reducing the incidence of such conflicts in new deployments.

Shared Memory and Address Space Issues

In a Windows , all loaded dynamic-link libraries (DLLs) share the same , which can lead to s if their preferred base addresses overlap. When such a occurs, the operating system must relocate one or more DLLs to available memory regions, adjusting internal pointers and references within the affected modules. This relocation introduces performance overhead, as it requires scanning and updating the DLL's relocation table during loading, potentially fragmenting the and complicating future allocations. The consequences of these issues extend beyond mere overhead. If a DLL lacks proper information or contains incompatible code assuming a fixed base address, relocation can result in crashes or , such as invalid memory accesses or corrupted data structures. Additionally, the shared enables global state pollution, where static variables or global data in one DLL can unintentionally interfere with those in another, leading to race conditions or erroneous computations if multiple DLLs modify overlapping resources without coordination. Address Space Layout Randomization (ASLR), introduced in in 2007, mitigates some of these issues by randomizing the base addresses of DLLs and the executable at process startup, reducing the likelihood of predictable overlaps and aiding in space utilization. However, ASLR does not fully eliminate conflicts, as address space fragmentation can still force relocations, and legacy DLLs without ASLR support may exacerbate problems. These challenges are particularly acute in 32-bit processes, which are limited to a 2 GB user-mode virtual address space (expandable to 3 GB with specific configurations), making overlaps and fragmentation more probable compared to 64-bit processes that support vastly larger address ranges. In contrast, 64-bit environments alleviate many such constraints, though shared state risks persist regardless of architecture.

Security Risks Including Hijacking

Dynamic-link libraries (DLLs) are susceptible to security risks stemming from their dynamic loading mechanism, particularly DLL hijacking, where attackers exploit the Windows DLL search order to load malicious code. In this attack, an adversary places a malicious DLL with the same name as a legitimate one in a directory that the application searches early in the loading process, such as the current working directory, causing the application to execute the attacker's code instead of the intended library. This vulnerability arises because applications often load DLLs without specifying fully qualified paths, allowing Windows to search multiple locations in a predefined order. The DLL search order vulnerability has been documented since 2009, notably in Security Bulletin MS09-015, which addressed flaws in the SearchPath function that could enable through manipulated DLL loading. To partially mitigate this, introduced SafeDLLSearchMode in 4 in 2003, which rearranges the search order to prioritize system directories (like the Windows system folder) over potentially untrusted locations such as the current directory, reducing the risk of loading malicious files from user-writable paths. This mode has been enabled by default since 2 in 2004. Other risks include buffer overflows in DLL export functions, where poorly implemented entry points can be exploited for when invoked by calling applications, potentially leading to remote code execution if the DLL is network-accessible. Additionally, unsigned DLLs are vulnerable to injection attacks, as applications may load them without verification, allowing attackers to substitute tampered versions that evade basic integrity checks. Key mitigations involve code signing DLLs with , Microsoft's technology, which verifies the publisher and integrity of the library before loading, preventing execution of unsigned or altered files. Application manifests can specify trusted DLL paths or side-by-side assemblies, redirecting loads to secure locations and avoiding ambiguous search orders. Since in 2007, (UAC) has added prompts for elevated privileges, limiting the impact of hijacked DLLs by restricting administrative access unless explicitly granted. In the modern context of 2025, these risks remain relevant for applications that do not implement path specifications or signing, particularly in environments supporting older software. For instance, in January 2024, security researchers disclosed a new variant of DLL search order hijacking that exploits the trusted WinSxS folder to bypass mitigations in and 11 by targeting vulnerable system binaries without requiring elevated privileges. Tools such as Microsoft's can identify vulnerable DLL loads by logging search attempts, enabling developers to and harden applications against unsafe loading behaviors.

Language and Compiler Considerations

C and C++

In C and C++, dynamic-link libraries (DLLs) are typically created and managed using Microsoft Visual C++ (MSVC) tools, where exports are defined to make functions, data, or classes available to client applications. To export symbols from a DLL, developers use the __declspec(dllexport) storage-class attribute applied to declarations in source or header files, which instructs the compiler to mark those symbols for export in the resulting DLL. Alternatively, a module-definition (.def) file can specify exports, including by ordinal values for performance or compatibility reasons, providing a text-based way to control the export table without modifying source code. When building the DLL with the MSVC compiler from the command line, the /LD option compiles the source files and links them into a DLL, using the multithreaded DLL runtime library by default. The MSVC linker automatically generates an import library (.lib file) from the exported symbols during this process, enabling implicit linking in client applications. For consuming DLLs in C and C++ applications, implicit linking involves declaring imported symbols with __declspec(dllimport) in header files provided by the DLL author, followed by linking against the generated import library. This can be automated in using the #pragma comment(lib, "dllname.lib") directive, which instructs the linker to include the specified import library without manual project configuration. In contrast, explicit linking loads the DLL at runtime using the function LoadLibrary from kernel32.dll, allowing dynamic resolution of exports via GetProcAddress for greater flexibility in loading paths or conditional usage. C++ introduces specific considerations due to its support for features like name mangling, where the compiler decorates symbol names to encode type information, resulting in exported functions having altered names (e.g., with prefixes and suffixes) that must match exactly between DLL and client for linking to succeed. To ensure compatibility, especially when interfacing with C code or non-mangled exports, the extern "C" linkage specification is used on exported functions, disabling mangling and producing standard C-style names. For more complex C++ DLLs requiring binary-stable interfaces across compiler versions or modules, the Component Object Model (COM) is commonly employed, structuring exports as COM objects with standardized vtables to abstract away mangling and ABI differences. Templates in C++ pose challenges for DLL export because they are compile-time constructs instantiated per translation unit, preventing direct export of the template itself from a DLL; instead, template definitions are typically placed in headers for inline instantiation in clients, or explicit template instantiations can be exported as concrete symbols if shared implementation is needed.

Visual Basic

In Visual Basic 6.0 (VB6) and (VBA), dynamic-link libraries (DLLs) are typically accessed through implicit linking via the Declare statement, placed at the module level to reference external procedures. This declaration provides the necessary details, including the DLL library name via the Lib clause, the procedure name, argument types and passing conventions (such as ByVal or ByRef), and the return , allowing developers to invoke DLL functions directly within VB code as if they were native procedures. The Declare statement supports aliases through the optional Alias clause to map VB-friendly names to the actual exported names in the DLL, and it can reference procedures by rather than string name for performance gains in scenarios where ordinals are documented. If the targeted DLL is unavailable at runtime, implicit linking results in errors like runtime error 53 ("File not found") or failure to load the , potentially crashing the application during startup. VB6 imposes notable limitations on DLL creation and usage, as it natively supports only DLL projects, which produce COM-compliant libraries rather than standard, non-COM DLLs; for the latter, developers must use companion languages like C++ to build the DLL and then declare its functions in VB6. This COM-centric approach ties VB6 DLLs closely to the (COM), where Type Libraries (TLB files)—binary files embedding metadata about classes, interfaces, methods, and properties—facilitate discovery, late binding, and . controls, frequently packaged as DLLs, serve as wrappers for reusable UI elements and , leveraging these TLBs for seamless integration in VB6 forms and applications without requiring explicit function declarations. Runtime dependencies on these DLLs can lead to deployment issues if registration via tools like regsvr32 fails or if version mismatches occur. For scenarios requiring runtime flexibility, such as conditional loading based on user input or error recovery, VB6 supports explicit linking by declaring functions like LoadLibrary to dynamically load a DLL and obtain a handle, followed by GetProcAddress to resolve addresses into callable pointers. This method bypasses startup-time but introduces complexity, as VB6's data types and lack of native pointer arithmetic demand careful manual marshalling, increasing the risk of leaks or type mismatches without the safeguards of lower-level languages. Explicit linking is particularly useful for optional DLLs but remains error-prone in VB6 due to its high-level abstractions. The transition to VB.NET with the .NET Framework 1.0 in 2002 marked a significant , introducing Platform Invoke (P/Invoke) as the primary mechanism for interoperating with unmanaged DLLs from managed code. P/Invoke declarations, using the <DllImport> attribute, enable calling external functions with automatic data marshalling between managed and unmanaged types, , and support for both standard Win32 DLLs and objects via interop assemblies. This approach addresses many VB6 limitations by providing , garbage collection for resources, and better performance isolation, though it still requires careful attribute configuration for complex structures or callbacks.

Delphi

In Delphi, which uses the language, dynamic-link libraries (DLLs) are created by initiating a with the library keyword instead of program, defining a module that can be dynamically loaded by applications. The structure includes a uses clause for dependencies, followed by procedure and function declarations, and concludes with an exports clause listing the routines to be made available externally, such as exports ProcedureName, FunctionName;. This clause can specify aliases or index numbers for exports, enabling compatibility with other languages. For , exported routines typically use the stdcall calling convention, which aligns with standards, though cdecl is also supported. Initialization code executes upon loading, allowing setup tasks like registering callbacks via DllProc. To use an external DLL in a application, procedures or functions are declared in a with the external directive specifying the DLL name, such as procedure ExternalProc; external 'MyDLL.dll';. This enables implicit linking at load time, with calling conventions like stdcall or cdecl explicitly stated if not using the default register. For explicit runtime loading, the Windows provides equivalents to Win32 : LoadLibrary to load the DLL by path, returning a , and GetProcAddress to retrieve addresses for dynamic invocation. Dynamic binding then uses the @ or procedural types to call these addresses, allowing conditional loading based on runtime conditions. Delphi extends standard DLL functionality through packages, which are specialized DLLs with the .bpl (Borland Package Library) extension, introduced in Delphi 2 in 1996 to support 32-bit Windows development. These enable runtime linking via LoadPackage and UnloadPackage from the SysUtils unit, facilitating modular code distribution beyond simple procedural exports. A key advantage of DLL handling in Delphi stems from Object Pascal's strong static typing, which enforces in external declarations and reduces interface errors during linking or calls. Additionally, many (VCL) components are distributed as DLLs or packages, promoting reusability in graphical applications while maintaining compile-time checks.

Programming Examples

Implicit Linking with Imports

Implicit linking with imports enables an application to access functions and data from a dynamic-link library (DLL) by resolving references at through an import library, allowing direct calls to the DLL's exports as if they were part of the itself. This approach uses an import library (.lib file), which contains stub code and about the DLL's exports, to embed references into the 's (PE) format during linking. The import library mechanics ensure that the linker generates an import table in the , specifying the DLL and the ordinals or names of the required functions. In a typical scenario, consider importing the MessageBoxA function from the system DLL user32.dll in a C++ application. The developer includes the <windows.h> header, which declares MessageBoxA as an external function, and links against user32.lib—the import library for user32.dll. The code can then invoke MessageBoxA directly, such as MessageBoxA(NULL, TEXT("Hello"), TEXT("Title"), MB_OK);, without runtime resolution code. The build process involves specifying the import library in the project settings or linker command line, such as using /link user32.lib in Microsoft Visual C++ (MSVC). At , the Windows loader automatically loads the DLL when the starts, resolves the actual addresses of the imported functions from the DLL's , and populates the 's Import Address Table (IAT) with these addresses, enabling seamless execution. If the DLL is absent, a required is missing, or version incompatibilities arise, the loader fails at load time, typically resulting in an error like "The specified could not be found" or a system dialog prompting for the missing file. This method is particularly suitable for core dependencies that are always required by the application, such as standard libraries, as it simplifies development and ensures immediate availability without additional checks.

Explicit Linking in C

Explicit linking in C, also referred to as run-time dynamic linking, enables a program to load a dynamic-link library (DLL) at execution time rather than at or load time. This method uses the LoadLibrary or LoadLibraryEx to obtain a for the DLL, followed by GetProcAddress to retrieve the of an exported within that DLL. The approach offers flexibility, such as loading DLLs conditionally based on conditions or delaying loading until a specific is needed, which can optimize memory usage and handle missing DLLs gracefully. To implement explicit linking, the program must include the <windows.h> header, which declares the required Win32 functions from libloaderapi.h. The process begins by calling LoadLibrary with the DLL's path or name; on success, it returns an HMODULE handle, which is invalid (NULL) on failure, prompting error retrieval via GetLastError. With the handle, GetProcAddress is invoked using the function's name (as a ) or ordinal value to obtain a , which is cast to the appropriate type for invocation; failure here also sets the last error code. After use, FreeLibrary decrements the DLL's reference count and unloads it if zero, ensuring proper resource cleanup. A representative example demonstrates loading the system DLL kernel32.dll and retrieving the GetTickCount function, which returns the milliseconds elapsed since system start. The code snippet below includes error checking:
c
#include <windows.h>
#include <stdio.h>

int main() {
    HMODULE hKernel32 = LoadLibraryA("kernel32.dll");
    if (hKernel32 == NULL) {
        DWORD error = GetLastError();
        printf("LoadLibrary failed with error %d\n", error);
        return 1;
    }

    typedef DWORD (WINAPI *GetTickCountFunc)();
    GetTickCountFunc pGetTickCount = (GetTickCountFunc)GetProcAddress(hKernel32, "GetTickCount");
    if (pGetTickCount == NULL) {
        DWORD error = GetLastError();
        printf("GetProcAddress failed with error %d\n", error);
        FreeLibrary(hKernel32);
        return 1;
    }

    DWORD ticks = pGetTickCount();
    printf("Milliseconds since start: %u\n", ticks);

    if (!FreeLibrary(hKernel32)) {
        DWORD error = GetLastError();
        printf("FreeLibrary failed with error %d\n", error);
    }

    return 0;
}
This example uses LoadLibraryA for ANSI strings and defines a function pointer type matching GetTickCount's signature (DWORD WINAPI GetTickCount(void)). The WINAPI calling convention ensures compatibility with the exported function. For compilation, Microsoft Visual C++ (MSVC) can build the program with the command cl program.c, as kernel32.dll functions like LoadLibrary and GetProcAddress are available via the default system libraries. Using with , compile via gcc program.c -o program.exe, with no additional linking flags required for kernel32.dll access, though -lkernel32 may be specified explicitly if needed. Both compilers link against the Windows SDK, ensuring the Win32 APIs are resolved at runtime for explicit loading.

Explicit Linking in Python

Explicit linking in Python is facilitated by the ctypes module, a component that enables calling functions in dynamic-link libraries (DLLs) or shared libraries through a , providing C-compatible data types without requiring compilation of extension modules. Introduced in 2.5 in 2006, ctypes allows scripts to dynamically load and interact with DLLs at , supporting cross-language access for tasks like interfacing with Windows APIs or third-party C libraries. This approach contrasts with implicit linking by offering flexible, on-demand loading without embedding dependencies in the interpreter. To load a DLL explicitly, import ctypes and use library loaders such as cdll.LoadLibrary(path), which returns a library object from which s can be accessed as attributes. For example:
python
from ctypes import cdll
lib = cdll.LoadLibrary("example.dll")
func = lib.function_name
result = func(arg)  # Call the [function](/page/Function) with appropriate [argument](/page/Argument)s
The cdll loader assumes the CDECL , common for shared libraries, while on Windows, windll and WinDLL are used for STDCALL conventions typical in Win32 APIs; windll automatically converts strings to byte or Unicode strings as needed, whereas WinDLL requires explicit handling to avoid mismatches. To ensure and prevent errors from incorrect passing, specify prototypes using argtypes for input parameters and restype for the return type, leveraging ctypes primitives like c_int, c_char_p, or c_wchar_p. For instance:
python
from ctypes import cdll, c_int, c_char_p
lib.function.argtypes = [c_int, c_char_p]
lib.function.restype = c_int
Failure to load a DLL, such as due to a missing file or dependent module, raises an OSError exception; common cases include [WinError 126] The specified module could not be found when a required DLL is absent. A practical example involves loading the Windows user32.dll to display a Unicode message box via MessageBoxW, which requires wide-character strings for internationalization:
python
from ctypes import windll, c_wchar_p
user32 = windll.user32
user32.MessageBoxW.argtypes = [c_wchar_p, c_wchar_p, c_wchar_p, c_int]
user32.MessageBoxW.restype = c_int
result = user32.MessageBoxW(None, "Hello, World!", "Title", 0)
This code loads the system DLL, defines the function signature to handle Unicode pointers and an integer flag (0 for OK button only), and invokes it to show a modal dialog, returning the user's response code. Such explicit linking enables Python applications to leverage existing DLL functionality seamlessly while maintaining script portability.

Component Object Model Integration

Dynamic-link libraries (DLLs) serve as in-process servers for the (COM), enabling the hosting of COM objects that can be instantiated by clients through the CoCreateInstance function, which loads the DLL and retrieves an interface pointer to the requested object based on its class identifier (CLSID). This approach allows COM components to execute within the client's process space, providing efficient access to object functionality without the overhead of . To enable discovery and instantiation, COM DLLs must export specific entry-point functions, including DllRegisterServer for creating registry entries that map CLSIDs to the DLL path and DllUnregisterServer for removing those entries, typically invoked via the utility. These functions ensure that the operating system can locate and load the DLL during CoCreateInstance calls, facilitating seamless integration of reusable components across applications. The integration leverages 's interface-based architecture, where objects expose contracts through immutable interfaces identified by unique interface identifiers (IIDs), promoting version tolerance by allowing new functionality via additional interfaces without altering existing ones. Universally unique identifiers (UUIDs), used for CLSIDs and IIDs, prevent naming conflicts and ensure global uniqueness, enhancing reliability in distributed environments. This design supports binary compatibility and extensibility, making DLL-hosted COM objects suitable for long-term software evolution. Object Linking and Embedding (OLE), an early precursor to full COM standardization, utilized DLLs for embedding and linking components starting with OLE 1.0 in 1990, laying the groundwork for modular Windows applications in the 1990s. To streamline development, the (ATL), introduced by in 1996, provides template-based C++ classes that simplify the creation of lightweight COM DLLs by automating boilerplate code for interfaces and registration. In modern contexts, DLL-based objects can interoperate with .NET applications through the Callable Wrapper (RCW), introduced in the .NET Framework 1.0 in 2002, which acts as a to calls between managed code and unmanaged components hosted in DLLs.

Cross-Platform Equivalents

In operating systems such as , the equivalent to Windows Dynamic-link Libraries (DLLs) are shared object files, typically with the .so extension. These files enable runtime linking, where libraries are loaded dynamically into a process using functions like dlopen() to open the library and obtain a , and dlsym() to retrieve the of specific symbols or functions within it. This mechanism supports modular code reuse and delayed loading, similar to DLLs, but operates within the (ELF) standard rather than the (PE) format used by DLLs. On macOS, dynamic libraries are implemented as .dylib files, managed by the dyld dynamic loader, which handles loading and linking at runtime. These libraries often integrate with frameworks, which bundle the .dylib along with headers, resources, and to facilitate sharing across applications while promoting versioned and encapsulated distribution. Like DLLs, .dylibs allow for sharing to reduce usage and enable updates without recompiling dependent executables, though they adhere to the executable format and leverage Darwin's POSIX-based APIs. Key differences arise from platform-specific architectures: DLLs are intrinsically bound to the PE format and the Win32 API for loading via functions like LoadLibrary() and GetProcAddress(), whereas .so files rely on and standards, and .dylibs use with dyld-specific behaviors. This ties DLLs closely to Windows' ecosystem, creating cross-compilation challenges; for example, generating .so files for requires platform-specific toolchains like configured for ELF output, often necessitating separate build environments. The introduction of .NET Core in 2016 marked a shift toward cross-platform compatibility, enabling assemblies—functional equivalents to DLLs—to be developed and deployed across Windows, , and macOS without platform-specific recompilation. This blurs traditional boundaries by allowing a single library binary to function similarly on multiple operating systems through . For porting DLL-based code to Unix-like systems, tools like provide a emulation layer on Windows, facilitating the recompilation of Windows applications into Unix-compatible formats by translating Win32 calls to equivalents during development. This approach emulates DLL behaviors in a Unix-like context on Windows, easing the transition to native .so or .dylib builds on target platforms.

References

  1. [1]
    Dynamic-Link Libraries (Dynamic-Link Libraries) - Win32 apps
    May 31, 2022 · A dynamic-link library (DLL) is a module that contains functions and data that can be used by another module (application or DLL).
  2. [2]
    Editor's Note: 20 Years and Still Going Strong! | Microsoft Learn
    May brings the first discussions of DLLs in the article "Design Concepts and Considerations in Building an OS/2 Dynamic-Link Library." The C language is ...
  3. [3]
  4. [4]
    About Dynamic-Link Libraries - Win32 apps | Microsoft Learn
    Jan 7, 2021 · Dynamic linking allows a module to include only the information needed to locate an exported DLL function at load time or run time.
  5. [5]
    OS/2 1.0
    When OS/2 was released, it was very modern and outdated at the same time. Features like multi-threading and dynamic linking were far from commonplace in 1987.
  6. [6]
    How were DLL functions exported in 16-bit Windows?
    Jul 14, 2006 · The whole point of dynamic link libraries (DLLs) is that the linkage is dynamic. Whereas statically-linked libraries are built into the ...
  7. [7]
    PE Format - Win32 apps - Microsoft Learn
    Jul 14, 2025 · The default for DLLs is 0x10000000. The default for Windows CE EXEs is 0x00010000. The default for Windows NT, Windows 2000, Windows XP, Windows ...
  8. [8]
    Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ...
    Jul 15, 2024 · System Requirements. Supported Operating Systems. Windows Server 2008, Windows XP, Windows Server 2003, Windows Server 2008 R2, Windows 7, ...
  9. [9]
    Microsoft Component Object Model (COM) - UMD Computer Science
    The Component Object Model: Technical Overview. This paper is adapted from an article appearing in Dr. Dobbs Journal, December 1994.Missing: history mid- 1990s
  10. [10]
    About Side-by-Side Assemblies - Win32 apps | Microsoft Learn
    Jan 7, 2021 · Starting with Windows XP, multiple versions of side-by-side assemblies can be used by applications running at the same time. Manifests, and ...Missing: 2001 | Show results with:2001
  11. [11]
    Application manifests - Win32 apps - Microsoft Learn
    May 30, 2024 · An application manifest is an XML file that describes and identifies the shared and private side-by-side assemblies that an application ...Missing: enhancements 2007
  12. [12]
    Microsoft Security Bulletin MS05-048 - Critical
    Microsoft will continue to fully support Windows Server 2003 for Itanium-based systems, Windows XP Professional x64 Edition, and Windows Server 2003 x64 ...
  13. [13]
    Packaging apps - UWP applications - Microsoft Learn
    Oct 20, 2022 · UWP apps are packaged in MSIX and .appx formats. .appx was the original format, renamed to .msix. App packages are needed for distribution.Missing: 2015 | Show results with:2015
  14. [14]
    Advantages of Dynamic Linking - Win32 apps - Microsoft Learn
    Jan 7, 2021 · Dynamic linking has the following advantages over static linking: A potential disadvantage to using DLLs is that the application is not self-contained.Missing: operating | Show results with:operating
  15. [15]
    [PDF] An Evil Copy: How the Loader Betrays You - Mathias Payer
    Modern operating systems adopt dynamic linking and loading to enable modularity. Dynamic linking has two major advantages over the traditional static linking.
  16. [16]
    Dynamic-link library redirection - Win32 apps - Microsoft Learn
    Oct 12, 2023 · Dynamic-link library (DLL) redirection is one of the techniques by which you can influence the behavior of the DLL loader, and control which one ...
  17. [17]
    Dynamic-link library search order - Win32 apps | Microsoft Learn
    Feb 9, 2023 · It's common for multiple versions of the same dynamic-link library (DLL) to exist in different file system locations within an operating ...
  18. [18]
    What Goes On Inside Windows 2000: Solving the Mysteries of the ...
    This article explores DLL loading and exposes what really goes on inside the Windows 2000 loader. Knowing how DLLs are loaded and where, and how the loader ...
  19. [19]
    Inside Windows: Win32 Portable Executable File Format in Detail
    When any PE file loads, one of the jobs of the Windows loader is to locate all the imported functions and data and make those addresses available to the file ...
  20. [20]
    DllMain entry point (Process.h) - Win32 apps | Microsoft Learn
    Sep 2, 2022 · The DLL is being loaded into the virtual address space of the current process as a result of the process starting up or as a result of a call ...
  21. [21]
    Load-Time Dynamic Linking - Win32 apps - Microsoft Learn
    Jan 7, 2021 · The DLL is mapped into the virtual address space of the process during its initialization and is loaded into physical memory only when needed.
  22. [22]
    Exporting from a DLL | Microsoft Learn
    Jun 25, 2025 · The exports table of a DLL can be viewed by using the DUMPBIN tool with the /EXPORTS option. You can export functions from a DLL using two ...
  23. [23]
    An In-Depth Look into the Win32 Portable Executable File Format ...
    The BindImage action of the Windows installer will do this for you. Alternatively, IMAGEHLP.DLL provides the BindImageEx API. Either way, binding is good idea.
  24. [24]
    What is DLL import hinting? - The Old New Thing
    Mar 17, 2010 · Binding and hinting are two types of optimizations to improve the load-time performance of a module (executable or DLL).Missing: Early | Show results with:Early
  25. [25]
    EXPORTS - Microsoft Learn
    Aug 2, 2021 · You can use @ordinal to specify that a number, and not the function name, goes into the DLL's export table. Many Windows DLLs export ordinals to ...
  26. [26]
    What is DLL import binding? - The Old New Thing
    Mar 18, 2010 · Binding therefore is a performance optimization to address both wall-clock running time (by reducing the amount of computation performed at module load time) ...Missing: Early | Show results with:Early
  27. [27]
    UNDER THE HOOD | Microsoft Learn
    Oct 25, 2019 · Optimizing load time involves basing DLLs to preferred addresses, binding imported functions, and importing by ordinal, which is faster than by ...Missing: Early | Show results with:Early
  28. [28]
    How important is it nowadays to ensure that all my DLLs have non ...
    Jan 20, 2017 · In the presence of ASLR, rebasing your DLLs has no effect because ASLR is going to ignore your base address anyway and relocate the DLL into a ...
  29. [29]
    /DELAYLOAD (Delay Load Import) | Microsoft Learn
    Aug 3, 2021 · The /DELAYLOAD option causes the DLL that's specified by dllname to be loaded only on the first call by the program to a function in that DLL.
  30. [30]
    Linker support for delay-loaded DLLs | Microsoft Learn
    Aug 3, 2021 · The MSVC linker supports the delayed loading of DLLs. This feature relieves you of the need to use the Windows SDK functions LoadLibrary and GetProcAddress to ...Missing: Early | Show results with:Early
  31. [31]
    Walkthrough: Create and use your own dynamic-link library (C++)
    This step-by-step walkthrough explains how to use the Visual Studio IDE to create your own dynamic-link library (DLL) written in Microsoft C++ (MSVC),
  32. [32]
    Using an Import Library and Export File - Microsoft Learn
    Aug 3, 2021 · You must use LIB to create an import library and export file for one of the programs. To begin, choose one of the programs on which to run LIB.
  33. [33]
    Working with Import Libraries and Export Files | Microsoft Learn
    Aug 3, 2021 · You can use LIB with the /DEF option to create an import library and an export file. LINK uses the export file to build a program that contains exports.
  34. [34]
    Link an executable to a DLL - Microsoft Learn
    Aug 3, 2021 · Implicit linking is sometimes referred to as static load or load-time dynamic linking. Explicit linking, where the operating system loads the ...
  35. [35]
    LoadLibraryA function (libloaderapi.h) - Win32 apps - Microsoft Learn
    Feb 9, 2023 · LoadLibraryA loads a module into the calling process's address space, using a specified module name, and returns a handle if successful.Parameters · Remarks · Syntax
  36. [36]
    GetProcAddress function (libloaderapi.h) - Win32 apps
    Feb 6, 2024 · Retrieves the address of an exported function (also known as a procedure) or variable from the specified dynamic-link library (DLL).Parameters · Remarks · RequirementsMissing: explicit | Show results with:explicit
  37. [37]
  38. [38]
    Run-Time Dynamic Linking - Win32 apps - Microsoft Learn
    Jan 7, 2021 · When the application calls the LoadLibrary or LoadLibraryEx functions, the system attempts to locate the DLL (for details, see Dynamic-Link ...
  39. [39]
    [MS-ERREF]: Win32 Error Codes - Microsoft Learn
    Nov 16, 2021 · ERROR_MOD_NOT_FOUND. The specified module could not be found. 0x0000007F. ERROR_PROC_NOT_FOUND. The specified procedure could not be found ...Missing: LoadLibrary | Show results with:LoadLibrary
  40. [40]
    /DELAY (Delay load import settings) | Microsoft Learn
    Sep 21, 2022 · The /DELAY option controls delayed loading of DLLs. The /DELAY:UNLOAD qualifier tells the delay-load helper function to support explicit unloading of the DLL.
  41. [41]
    Understand the delay load helper function | Microsoft Learn
    Aug 2, 2021 · The helper function for linker-supported delayed loading is what actually loads the DLL at runtime. You can modify the helper function to customize its ...
  42. [42]
    Under the Hood, MSJ December 1998 - Jacob Filipp
    One of the coolest new features in Visual C++® 6.0 is the /DELAYLOAD linker option. Executables that use the /DELAYLOAD option don't implicitly link to the DLLs ...
  43. [43]
    Dynamic link library (DLL) - Windows Client - Microsoft Learn
    Jan 15, 2025 · This article describes what a dynamic link library (DLL) is and the various issues that may occur when you use DLLs.
  44. [44]
    C++ at Work: Writing, Loading, and Accessing Plug-Ins
    Oct 18, 2019 · I'm working on an existing Visual C++® 6.0 application that has a plug-in architecture supporting DLLs which export and accept pure virtual interface pointers.
  45. [45]
    Dynamic-Link Library Updates - Win32 apps - Microsoft Learn
    Jan 7, 2021 · It is possible to replace a DLL that is in use. The method you use to replace DLLs that are in use depends on the operating system you are using.
  46. [46]
    Guidelines for Creating Side-by-side Assemblies - Win32 apps
    Jan 7, 2021 · Any data structures used across assembly versions must be backward-compatible versions. Decide which data structures can be used across ...
  47. [47]
    Strong naming and .NET libraries - Microsoft Learn
    When an assembly is strong-named, it creates a unique identity based on the name and assembly version number, and it can help prevent assembly conflicts.
  48. [48]
    Strong-named assemblies - .NET - Microsoft Learn
    Sep 15, 2021 · When a strong-named assembly is created, it contains the simple text name of the assembly, the version number, optional culture information, a ...
  49. [49]
    Registration-Free COM Interop - .NET Framework - Microsoft Learn
    Sep 15, 2021 · Use registration-free COM interop to activate a component without using the Windows registry to store assembly information.Missing: private | Show results with:private
  50. [50]
    Creating Registration-Free COM Objects - Win32 apps
    Jan 7, 2021 · COM objects can be used without registration using activation contexts. COM searches the active context first, and multiple components can ...Missing: private | Show results with:private
  51. [51]
    Working with AppLocker rules - Microsoft Learn
    Oct 1, 2024 · This article for IT professionals describes AppLocker rule types and how to work with them for your application control policies.Missing: 2010 | Show results with:2010
  52. [52]
    Avoiding DLL Hell: Introducing Application Metadata in the Microsoft ...
    Oct 24, 2019 · In this article, I'll present you with a 5000-foot overview of metadata. I'll look at the major features and important details of this key .NET innovation.Missing: history | Show results with:history
  53. [53]
    DLL Hell: Software Dependencies, Failure, and the Maintenance of ...
    Oct 25, 2018 · DLL Hell: Software Dependencies, Failure, and the Maintenance of Microsoft Windows. Abstract: Software is relational. It can only operate ...
  54. [54]
    DLL Hell: Software Dependencies, Failure, and the Maintenance of ...
    Livingston returned to the subject frequently over in years, introducing the phrase “DLL hell” in Jan. 1998: B. Livingston, “Window Manager: Can. Windows 98 ...Missing: coined | Show results with:coined
  55. [55]
    Windows XP: Escape from DLL Hell with Custom Debugging and ...
    This is perfect for finding loading conflicts and they make ideal targets for rebasing, as Figure 4 illustrates. In that figure you can see that WinRAR ...
  56. [56]
    A fine detail on how DLLs are relocated as the result of a base ...
    Jan 19, 2017 · If a DLL must be relocated due to a base address conflict, then the image will be relocated, and the entire relocated DLL is now backed by the ...
  57. [57]
    GNAT User's Guide: Microsoft Windows Topics
    Jun 15, 2005 · If the addresses of two non-relocatable DLLs overlap and these happen to be used by the same application, a conflict will occur and the ...
  58. [58]
    Dynamic-Link Library Data - Win32 apps - Microsoft Learn
    Jan 7, 2021 · A Dynamic-Link Library (DLL) can contain global data or local data. Variable Scope Variables that are declared as global in a DLL source code file are treated ...Missing: upgradability | Show results with:upgradability
  59. [59]
    DYNAMICBASE (Use address space layout randomization)
    May 6, 2022 · ASLR is supported on Windows Vista and later operating systems. The option is ignored by earlier operating systems. By default, /DYNAMICBASE is ...Missing: mitigation | Show results with:mitigation
  60. [60]
    Six Facts about Address Space Layout Randomization on Windows
    Mar 17, 2020 · Address space layout randomization is a core defense against memory corruption exploits. This post covers some history of ASLR as implemented on Windows.
  61. [61]
    Memory Limits for Windows and Windows Server Releases
    Jun 11, 2025 · User-mode virtual address space for each 32-bit process, 2 GB Up to 3 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE and 4GT, 2 GB with ...
  62. [62]
    Virtual Address Space (Memory Management) - Win32 apps
    Jan 7, 2021 · The virtual address space for 32-bit Windows is 4 gigabytes (GB) in size and divided into two partitions: one for use by the process and the other reserved for ...Missing: DLL conflicts base overlap documentation
  63. [63]
    Dynamic-Link Library Security - Win32 apps | Microsoft Learn
    Jan 7, 2021 · When an application dynamically loads a dynamic-link library without specifying a fully qualified path name, Windows attempts to locate the ...<|control11|><|separator|>
  64. [64]
    Triaging a DLL planting vulnerability - Microsoft
    Apr 4, 2018 · DLL planting (aka binary planting/hijacking/preloading) resurface every now and then, it is not always clear on how Microsoft will respond ...
  65. [65]
    Microsoft Security Bulletin MS07-015 - Critical
    This update resolves two newly discovered, privately and publicly reported vulnerabilities. Each vulnerability is documented in its own subsection.
  66. [66]
    Manifests - Win32 apps - Microsoft Learn
    Jan 7, 2021 · Manifests are XML files that accompany and describe side-by-side assemblies or isolated applications. Manifests uniquely identify the assembly.
  67. [67]
    Exporting from a DLL Using __declspec(dllexport - Microsoft Learn
    Jun 24, 2025 · You can export data, functions, classes, or class member functions from a DLL using the __declspec(dllexport) keyword.
  68. [68]
    Exporting from a DLL Using DEF Files - Microsoft Learn
    A module-definition or DEF file (*.def) is a text file containing one or more module statements that describe various attributes of a DLL.
  69. [69]
    /MD, /MT, /LD (Use runtime library) | Microsoft Learn
    Mar 28, 2025 · Indicates whether a multithreaded module is a DLL and specifies retail or debug versions of the runtime library.
  70. [70]
    Import into an application using __declspec(dllimport - Microsoft Learn
    Jun 24, 2025 · When you create header files for applications that use your DLLs to build with, use __declspec(dllimport) on the declarations of the public symbols.
  71. [71]
    comment pragma | Microsoft Learn
    Aug 3, 2021 · Places a comment record into an object file or executable file. Syntax: #pragma comment( comment-type [ , "comment-string" ] )Syntax · Remarks
  72. [72]
    dllexport, dllimport | Microsoft Learn
    Mar 29, 2024 · You can use them to export and import functions, data, and objects to or from a DLL. Syntax. __declspec( dllimport ) declarator __declspec( ...
  73. [73]
    The extern "C" specifier disables C++ mangling, but that doesn't ...
    May 25, 2012 · dllexport of a C++ function will expose the function with C++ name mangling. To disable name mangling either use a .def file (EXPORTS keyword) ...
  74. [74]
    The COM Library - Win32 apps - Microsoft Learn
    May 6, 2020 · Provided as a set of DLLs and EXEs (primarily Ole32.dll and Rpcss.exe) in Microsoft Windows, the COM library includes the following:
  75. [75]
    Templates (C++) - Microsoft Learn
    Oct 3, 2025 · A template is a construct that generates an ordinary type or function at compile time based on arguments the user supplies for the template parameters.
  76. [76]
    Declare statement (VBA) | Microsoft Learn
    Mar 30, 2022 · This example shows how the Declare statement is used at the module level of a standard module to declare a reference to an external procedure in ...
  77. [77]
    Visual Basic 6.0 Documentation - Microsoft Learn
    Jan 18, 2018 · This article will walk you through the steps of building a Visual Basic 6.0 ActiveX dynamic-link library (DLL) that will make it easy and ...Missing: history introduction
  78. [78]
    Contents of a Type Library | Microsoft Learn
    May 30, 2018 · Type libraries are binary files (.tlb files) that include information about types and objects exposed by an ActiveX application.Missing: Visual Basic
  79. [79]
    Platform Invoke (P/Invoke) - .NET - Microsoft Learn
    May 10, 2024 · P/Invoke is a technology that allows you to access structs, callbacks, and functions in unmanaged libraries from your managed code.
  80. [80]
    Writing Dynamically Loaded Libraries - RAD Studio
    You can put exports clauses in the interface or implementation section of a unit. Any library that includes such a unit in its uses clause automatically exports ...Missing: keyword | Show results with:keyword
  81. [81]
    Procedures and Functions (Delphi) - RAD Studio
    ... stdcall and safecall are recommended, in general, for calls to external code. ... external <stringconstant> indicates that the function/procedure lives in a DLL.
  82. [82]
    Libraries and Packages (Delphi) - RAD Studio - Embarcadero DocWiki
    Delphi programs can call DLLs ... This can be done in two ways: by declaring an external procedure or function, or by direct calls to the operating system.Missing: keyword stdcall
  83. [83]
    None
    Nothing is retrieved...<|separator|>
  84. [84]
    How to Create and Use DLLs in Delphi - ThoughtCo
    May 13, 2025 · To use a DLL in Delphi, compile it and call its procedures with specific keyword instructions. A Dynamic Link Library (DLL) ... exports DllMessage;
  85. [85]
    MessageBoxA function (winuser.h) - Win32 apps | Microsoft Learn
    Feb 8, 2023 · In the following example, the application displays a message box that prompts the user for an action after an error condition has occurred. The ...Parameters · Remarks · ExamplesMissing: implicit linking
  86. [86]
    The Import Address Table is now write-protected, and what that ...
    Oct 6, 2022 · The Import Address Table is now write-protected. Once the loader has obtained all the function pointers, it write-protects the table to make it harder for an ...Missing: implicit | Show results with:implicit
  87. [87]
    ctypes — A foreign function library for ... - Python documentation
    ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries.
  88. [88]
    Ctypes — SciPy Cookbook documentation - Read the Docs
    May 5, 2006 · ctypes allows to call functions exposed from DLLs/shared libraries and has extensive facilities to create, access and manipulate simple and ...
  89. [89]
    CoCreateInstance function (combaseapi.h) - Win32 apps
    Oct 18, 2021 · Creates and default-initializes a single object of the class associated with a specified CLSID. Call CoCreateInstance when you want to create only one object ...
  90. [90]
    Classes and Servers - Win32 apps | Microsoft Learn
    Aug 21, 2020 · COM servers support self-registration. For an in-process server, this means that the DLL must export the following functions: DllRegisterServer ...
  91. [91]
    The Component Object Model - Win32 apps - Microsoft Learn
    Aug 23, 2019 · The Microsoft Component Object Model (COM) is a platform-independent, distributed, object-oriented system for creating binary software components that can ...Missing: tolerant UUID
  92. [92]
    DllRegisterServer function (olectl.h) - Win32 apps | Microsoft Learn
    Feb 22, 2024 · Instructs an in-process server to create its registry entries for all classes supported in this server module.
  93. [93]
    DllUnregisterServer function (olectl.h) - Win32 apps - Microsoft Learn
    Feb 22, 2024 · Instructs an in-process server to remove only those entries created through DllRegisterServer. Syntax: HRESULT DllUnregisterServer();
  94. [94]
    Self-Registration - Win32 apps - Microsoft Learn
    Aug 21, 2020 · Within DllRegisterServer, the DLL creates all its necessary registry entries, storing the correct path to the DLL for all InprocServer32 or ...Missing: process | Show results with:process
  95. [95]
    COM Technical Overview - Win32 apps - Microsoft Learn
    Jan 6, 2021 · A client requests an interface pointer to a COM object from the COM Library by calling a function such as CoCreateInstance with the CLSID of the ...
  96. [96]
    Object Linking and Embedding (OLE) - CIO Wiki
    Jan 16, 2023 · OLE 1.0: OLE 1.0, released in 1990, was an evolution of the original Dynamic Data Exchange (DDE) concept that Microsoft developed for earlier ...
  97. [97]
    Active Template Library (ATL) Concepts | Microsoft Learn
    Jun 25, 2025 · The Active Template Library (ATL) is a set of template-based C++ classes that let you create small, fast Component Object Model (COM) objects.
  98. [98]
    Runtime Callable Wrapper - .NET - Microsoft Learn
    Apr 19, 2023 · The CLR exposes COM objects through a runtime callable wrapper, which manages calls between a .NET client and a COM object.
  99. [99]
    dlopen(3) - Linux manual page - man7.org
    dlopen() The function dlopen() loads the dynamic shared object (shared library) file named by the null-terminated string path and returns an opaque "handle" ...
  100. [100]
    dlsym(3) - Linux manual page - man7.org
    The function dlsym() takes a "handle" of a dynamic loaded shared object returned by dlopen(3) along with a null-terminated symbol name, and returns the address.
  101. [101]
    SQL Server on Linux: ELF and PE Images Just Work
    Feb 24, 2022 · This post takes a minute to focus on the specific concept of of ELF vs PE images. ELF image format is the image format know to the Linux kernel.
  102. [102]
    Dynamic Library Usage Guidelines - Apple Developer
    Jul 23, 2012 · Dynamic Library Usage Guidelines. The dynamic loader compatibility functions provide a portable and efficient way to load code at runtime.
  103. [103]
    Using Dynamic Libraries - Apple Developer
    Jul 23, 2012 · Using Dynamic Libraries. When you need to use a dynamic library in your product, you have to install the library in your computer.
  104. [104]
    Cross-compiling from Linux to Windows with MinGW - Conan docs
    It is possible to cross-build from Linux to Windows using the MinGW cross-compiler. Note that such a compiler won't be using the MSVC runtime, but the MinGW ...
  105. [105]
    NET Core - .NET Goes Cross-Platform with .NET Core
    At Microsoft, we're buildinga new implementation of .NET, called .NET Core, to let you write cross-platform code for cloud-optimized workloads.What's . Net Core? · Scenarios For . Net Core · How . Net Core Compares With...
  106. [106]
    Building and Using DLLs - Cygwin
    The dlltool program creates the exports section of the dll from your text file of exported symbols. The import library is a regular UNIX-like .a library, but it ...