Registering every *.DLL required? or possible?


  1. Posts : 244
    win7pro 64bit
       #1

    Registering every *.DLL required? or possible?


    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


  2. Posts : 318
    Windows 10 x64
       #2

    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


  3. Posts : 244
    win7pro 64bit
    Thread Starter
       #3

    margrave said:
    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


  4. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #4

    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.

    pstein said:
    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.

    pstein said:
    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
    pstein said:
    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.

    pstein said:
    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


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:45.
Find Us