Registering every *.DLL required? or possible?

pstein

New member
Member
VIP
Local time
3:09 PM
Messages
244
Assume I have (under 64bit Win 7) a big program installation with one main *.exe file and lots of *.dlls.

It seems to me that some but not all of these *.dlls need a registration (by regsvr32) which is done typically at installation time.
Some other *.dlls seem to need NO such registration but are accessed dynamically from the program on-demand.

So are there two such types of *.dlls ?

How do I find out which type of DLL lets say myspecial.dll is?

Now lets say that I got an older installation on an USB flash drive.
I have not the original installation setup package.

In order to make it runnable some of these DLLs must be registered now, afterwards.
Can I just register all of them by simply entering:

regsvr32 myspeciallib1.dll
regsvr32 myspeciallib2.dll
...
regsvr32 myspeciallib9.dll
?

Does it hurt if a DLL which is actually not designed for registration is registered anyway?

I am interested only in DLL handling. Other possible issues like missing Registry entries shouldn't be discussed here.

Thank you
Peter
 

My Computer My Computer

At a glance

win7pro 64bit
Computer type
PC/Desktop
OS
win7pro 64bit
When you say "Assume I have (under 64bit Win 7) a big program installation with one main *.exe file and lots of *.dlls." ...

Are you speaking about an existing application, and are wondering which dll files should or should not be registered?

Or are you developing a program, and are wondering how to create an installer, and are trying to decide which dll files should be registered and which not?
 

My Computer My Computer

At a glance

Windows 10 x64i7-7700K16 GB 2400 MHzGTX 1060
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 10 x64
CPU
i7-7700K
Memory
16 GB 2400 MHz
Graphics Card(s)
GTX 1060
Sound Card
Integrated, plus external Presonus Audiobox USB
Monitor(s) Displays
2x AOC 27"
Screen Resolution
1920x1080
Hard Drives
512 GB M.2 SSD
2 TB 7200 RPM disk
Internet Speed
110 Mbps
Browser
Firefox
When you say "Assume I have (under 64bit Win 7) a big program installation with one main *.exe file and lots of *.dlls." ...

Are you speaking about an existing application, and are wondering which dll files should or should not be registered?

Existing program not developed by me
 

My Computer My Computer

At a glance

win7pro 64bit
Computer type
PC/Desktop
OS
win7pro 64bit
Hi,

Most dlls aren’t typically registered. It’s only those dlls that implement a mechanism through which software components will be able to communicate with that require registering, and so to do this the dll fills the registry with appropriate lookup and versioning information. Pretty much, the only time this happens is when registering a COM object. So you can imagine how many dlls actually need registering.

It’s worth realising that a dll is synonymous to an executable. When a dll is registered with RegSvr32, all RegSvr32 does is execute a function called “DllRegisterServer” contained within the dll. This can be any arbitrary code. Likewise, when a dll is unregistered with RegSvr32 it simply calls the “DllUnregisterServer” function.

It’s rare that a third party dll would require registration. If an application happens to come bundled with a dll that requires registering, the installer usually takes care of the dll registration.

So are there two such types of *.dlls ?
If you want to think of it that way. Really, there isn’t any other distinguishing feature about a dll that can be registered aside from the fact that it defines DllRegisterServer and DllUnregisterServer.

How do I find out which type of DLL lets say myspecial.dll is?
“Myspecial.dll” is register-able if it defines a DllRegisterServer method, so all we have to do is check if this entry point exists in the dll. Unfortunately, there’s not much in the way of builtin tools that can help with this though. I know if Visual Studio is installed you can use the Dumpbin command in the developer command prompt.
Code:
dumpbin /exports "file.dll" | find "DllRegisterServer" >NUL && echo This dll can be registered || echo This dll cannot be registered

In order to make it runnable some of these DLLs must be registered now, afterwards.
Can I just register all of them by simply entering:
If they’re just different versions of the same dll, I’d say the registrations would overwrite one another. It’s theoretically impossible to tell though without decompiling the binary.

Does it hurt if a DLL which is actually not designed for registration is registered anyway?
No. If you register a dll with RegSvr32 and it can’t find a DllRegisterServer method then it will inform you and nothing else will happen.
 

My Computer My Computer

At a glance

Windows 10, Windows 8.1 Pro, Windows 7 Profes...
Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top