calling application

Hi! How can I obtain the name of applications accessing my dll pls?
... with great difficulty. I'd go as far to say you can't.

First, you need the list of applications to check. This might be all the applications on your machine, or it could be all the applications on all the computers that can connect to your machine over SMB.

Then you need to check each for loadtime dependency.

Then you need to check each for runtime dependency. If the name is constructed within the application, you may never find it.
thx for the answer.
If I get to know which processes might access my dll, how could I check the loadtime and runtime dependency? Let's say that winlogon.exe and explorer.exe amongst other applications might access my dll, how could I proceed?
For load time dependencies, see Depends: http://www.dependencywalker.com/

Someone else might be able to provide source code for what you need. If not, check out the PE executable format.

As for runtime loading, you may want to search the executables (and DLLs and registry) for the name of your DLL.
Thankyou for your help!
... with great difficulty. I'd go as far to say you can't.

???
You can do ***everything*** in Win32
In this case, it's trivial : simply enumerate modules and associated processes which have loaded them in their address space !
... and if the DLL hasn't been loaded?
Har...

The easiest way to get the file name of the applications that are accessing your DLL is to simply use GetModuleFileName() in your DLL's initialization code (DllEntryPoint() or whatever you use), and write it to some file.

Hence, every program/process that loads your DLL will have its name listed in the file, which you can review at any time.


If you want to know the names of all applications that might access your DLL, then you'll have to scan the entire computer looking for your DLL's name in the PE32 Import Tables and in the Data Segments, and you'll have to do something to eliminate false positives (in case someone else has a DLL with your DLL's name... or random data reads as your DLL's name). Keep in mind that this data is stored in WCHAR entities in the PE32 Import Table, and may additionally be stored as a CHAR entity elsewhere.

Good luck!
Topic archived. No new replies allowed.