0% found this document useful (0 votes)
270 views

Plugins and Rule of Thumb For DLL

Uploaded by

Tejasree M.S.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views

Plugins and Rule of Thumb For DLL

Uploaded by

Tejasree M.S.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Plug-ins and Rule

of Thumb for
Using DLLs
DLL (Dynamic Link Library)

➢ Mechanism that links applications to libraries at run time.

➢ Placed in files with different extensions such as .so in Linux and .dll in

Windows

➢ Used in 2 ways:

○ Implicitly linked to application

○ Loaded dynamically at run time (Explicit)


Advantages of DLL

● Uses fewer resources


● Promotes modular architecture
● Aid easy deployment and installation
● Fewer faults

Disadvantages of DLL

● Does not reduce program’s time complexity


● Page fault
● Slows down execution
Types of DLL

1. Simple

Contains only DLL code in which special code sequences are


generated by the compiler for referencing functions and external variables,
using function pointers. With these code sequences, a DLL application can
reference imported functions and imported variables from a DLL as easily as it
can reference non-imported ones.

2. Complex

Contains mixed code, that is, some DLL code and some non-DLL
code. A typical complex DLL would contain some C++ code, which is always
DLL code, and some C object modules compiled with the NON-DLL compiler
option bound together.
Reasons for DLL Errors

● Malware

● File corruption

● File deletion
Rule of Thumb

● Name the DLL based on the common prefix of the namespaces contained in the assembly.

For Eg: An assembly with two namespaces, “MyCompany.MyTechnology.FirstFeature” and

“MyCompany.MyTechnology.SecondFeature” could be called “MyCompany.MyTechnology.dll”

● Postpone initialization as much as possible. Lazy initialization increases robustness of the

application because the initialization is not performed while the loader lock is held. Also, lazy

initialization enables you to safely use much more of the Windows API.
Important DLL Files

● COMDLG32.DLL − Controls the dialog boxes.


● GDI32.DLL − Contains numerous functions for drawing graphics, displaying
text, and managing fonts.
● KERNEL32.DLL − Contains hundreds of functions for the management of
memory and various processes.
● USER32.DLL − Contains numerous user interface functions. Involved in the
creation of program windows and their interactions with each other.
DLL Plugins

It provides means to split bundles in a way that can drastically improve build time
performance

1. DLLPlugin
2. DLLReferencePlugin
DLL Plugin

Used in a separate webpack configuration exclusively to create a dll-only-bundle.


It creates a manifest.json file, which is used by the DllReferencePlugin to map
dependencies.

● Context (optional): context of requests in the manifest file (defaults to the


webpack context)
● Format (boolean = false): If true, manifest json file (output) will be
formatted.
● Name: name of the exposed dll function (TemplatePaths: [fullhash] & [name]
)
● Path: absolute path to the manifest json file (output)
● EntryOnly (boolean = true): if true, only entry points will be exposed
● Type: type of the dll bundle
DllReferencePlugin

Used in the primary webpack config, it references the dll-only-bundle(s) to require pre-
built dependencies.

● Context: (absolute path) context of requests in the manifest (or content property)
● Extensions: Extensions used to resolve modules in the dll bundle (only used when
using 'scope').
● Manifest : an object containing content and name or a string to the absolute path
of the JSON manifest to be loaded upon compilation
● Content (optional): the mappings from request to module id (defaults to
manifest.content)
● Name (optional): an identifier where the dll is exposed (defaults to manifest.name)
(see also externals)
● Scope (optional): prefix which is used for accessing the content of the dll
● SourceType (optional): how the dll is exposed (libraryTarget)

You might also like