Display Loaded Modules

Sample Image

Environment: VC6 SP3, NT4 SP4, Windows 95/98

Have you ever experienced an error while loading a DLL when you start an application? Invalid DLL version? Entry point @XXXX not found?

If the answer is yes, then this application is for you!

On you LAN, there may be thousands of versions of a DLL! Which version are you using? Which DLL has effectively been loaded by your application? You must check the PATH, the current working directory of your process, etc...

This small application, called "DisplayLoadedModules", connects to a running process, gets the list of DLLs loaded by the process, and display the following information for every DLL:

  • Module File Path (e.g. "C:\WINNT4\System32\WS2_32.dll")
  • Module Description (e.g. "Windows Socket 2.0 32-Bit DLL")
  • Module File Version (e.g. "4.00")
  • Associated Product Name (e.g. "Microsoft(R) Windows NT(TM) Operating System")
  • Associated Product Version (e.g. "4.00")
  • Module File Size (e.g. "59664 bytes")
  • Module Creation Date (e.g. "October 14, 1996 03:38:00")

You can also click on the "Who's Locking?" button to find which process has loaded (and thus locked) a DLL. Usefull when you want to delete/move/upgrade a DLL and you get an access denied error (you find the process which locks the DLL and stop it instead of rebooting your computer).

The application can also save the output to a text file. If your application runs on a machine "A" and not on a machine "B", you can compare (using 'diff' or 'windiff') the output of the program on both machines. If you're experiencing a DLL versioning problem, you'll figure out very easily...

On Windows NT, the executable uses one additional DLL: PSAPI.DLL For more on these APIs, please refer to MSDN Platform SDK:

On Windows 98, the executable uses the ToolHelp32 library. For more on this APIs, please refer to MSDN Platform SDK:

What's new in version 1.10

Regarding to previous version posted in Codeguru (v1.4), this new release provides the following new features:

  • Who's Locking Button: find which process is locking a DLL.
  • Resizable window
  • Runs on Windows NT, Windows 98 and Windows 95 with one executable
  • Cleaner Source Code: one reusable C++ class to browse through running processes/modules.
  • Three kits: Source Code only, small kit (executable plus documentation only), full kit (with MFC 42 version 6.0 DLL, for plain systems without VC++ 6.0 installed).

Acknowledgement

The version info is fetched via the CFileVersion class by Manuel Laflamme (posted in www.codeguru.com).

Web Site

This tool is also available on my web site:

http://www.kartmann.claranet.fr/tools.htm
http://www.kartmann.claranet.fr/tools/DisplayLoadedModules/Readme.htm

Downloads

Download runtime - 112 Kb
Download source - 91 Kb


Comments

  • Saved my hair!

    Posted by Legacy on 09/26/2003 12:00am

    Originally posted by: Dan

    I was pulling my hair out trying to locate a "missing" DLL after our corporate upgrade to XP rendered one of my VB apps useless. The VB app refused to open an access database after the OS upgrade. Installing VB6 would solve the problem, but buying licsences for all end users was out of the question. And it appeared to be a monumental task to have to figure out what file of the 145M of installed files was solving my problem. Dependency Walker didn't shed any light on the problem...this had to be done dynamically as the app ran. DisplayLoadedModules gave me a quick save to disk of my app running and not. Loaded into CodeWright and a quick file compare revealed 4 files of difference. One was an error loaded when the program failed to run...eliminated. Two were the DLL's where the data eventually was loaded into...eliminated. There's one left. And it's already on the system. Using RegSvr32, I find it's not in the registry. So in the registry it goes and my VB app is merrily on it's way to opening access databases and running again! THANKS!!! for an awesome little application!!!!

    Reply
  • Exelent tool

    Posted by Legacy on 11/27/2002 12:00am

    Originally posted by: Dror Elul

    great tool it is much better than other tool such as dependecies that come with VC6
    very good.

    Reply
  • DLL

    Posted by Legacy on 04/29/2002 12:00am

    Originally posted by: JERRY

    HOW DO I RE LOAD DLL WS_32.DILL

    Reply
  • error on loading Visual studio

    Posted by Legacy on 02/20/2001 12:00am

    Originally posted by: afzal qais

    I am getting the very same message while opening any of the Visual Studio application. I have tried to Uninstall/Reinstall all the Vstudio programs, but i have not been successfull. could you tell me what i need to do
    
    Thank you so much
    Afzal Qais
    boston

    Reply
  • Nice job. Suggestion - sortable columns.

    Posted by Legacy on 04/27/2000 12:00am

    Originally posted by: Chad Varner

    NTHandleEx.exe has solved many problems for me in NT, but of course it is totally useless on Win9x. Your tool does everything NTHandleEx does, and works on both platforms - thank you for making my life a little easier.

    It would be nice if you could sort the data by any given column, by clicking on the column-header button. The default sort order is good, but other sort options would come in handy.

    Reply
  • Have you tried delay loading of dll's

    Posted by Legacy on 02/15/2000 12:00am

    Originally posted by: Scottski

    I know that you can deload dll's now with visual c++ 6.0.  I see that you manually load the dll's functions via pointers.  Have you tried the delay loading of dll's now available.  I have attempted this with the Kernal32.dll and the psapi.dll but had no luck.
    
    Even if you tell the linker not to load a dll entry point it still does. Prob I am doing this wrong. Anyone else had any success?

    Reply
  • Great Work !!!

    Posted by Legacy on 01/17/2000 12:00am

    Originally posted by: Christian Scholz

    Great work !

    Exactly what I need to implement in my app.
    I recently run into the problem that different parts of my app do not work because the user installs a programm which setup do not cares about overwriting a DLL with a higher version.
    Now I can check, if the needed version is loaded by my app.

    Thanks again for this great classes.
    Christian

    Reply
  • I can't wait for Windows 2000... The End of DLL Hell (or so they say...)

    Posted by Legacy on 01/12/2000 12:00am

    Originally posted by: Emmanuel KARTMANN


    Check this out... "The End of DLL Hell"
    http://msdn.microsoft.com/library/techart/dlldanger1.htm

    Soon, very soon, my program will be useless. Until then, feel free to use it.

    Emmanuel

    Reply
  • How about COM Objects...

    Posted by Legacy on 01/11/2000 12:00am

    Originally posted by: John Katich

    It there a way to show DLLs that have been loaded as COM objects? Currently this program does not show them..

    Reply
  • New version available (v1.10)

    Posted by Legacy on 12/09/1999 12:00am

    Originally posted by: Emmanuel KARTMANN


    You can download the new version from my web site (I will post it to codeguru, though).

    http://www.kartmann.claranet.fr/tools.htm

    New features:
    * Who's Locking Button: find which process is locking a
    DLL.
    * Resizable window
    * Runs on Windows NT and 98 with one executable
    (and maybe on Win95... not tested!)
    * Cleaner Source Code: one reusable C++ class to browse
    through running processes/modules.
    * Three kits: Source Code only, small kit (executable
    plus documentation only), full kit (with MFC 42 version 6.0
    DLL, for plain systems without VC++ 6.0 installed).

    Enjoy!

    Emmanuel

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: August 19, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT You deployed your app with the Bluemix PaaS and it's gaining some serious traction, so it's time to make some tweaks. Did you design your application in a way that it can scale in the cloud? Were you even thinking about the cloud when you built the app? If not, chances are your app is going to break. Check out this upcoming webcast to learn various techniques for designing applications that will scale successfully in Bluemix, for the …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds