dll communicating between each other
I have installed a global hook and injected my dll into all running processes. The exe file that installed the hook calls one of the dll's callback functions when one of its variables reaches a certain amount. But the dll that the exe file calls is the one that is attached to its own process. If i know the HMODULE of a certain dll that is attached to another process (by putting it in the shared area) then is there away that i can call a function in that dll from the other dll? I know that sounds confusing so i'll try an example. Lets say i have 2 processes running
and i use MyProg.exe to inject a dll called MyDll.dll into all running processes (so just into the two above). Now the dll injected into Notepad.exe stores its HMODULE into the shared area so the dll in MyProg.exe can also see it.
Now when MyProg changes state (like if a variable gets larger than 10). The MyProg calls a function in the dll module that it is attached to (say it executes a function called function1() in the dll). The function1() of the dll attached to MyProg cheacks the shared data for the HMODULE of the other dll attached in Notepad.exe and it wants to call a funcation (say function2()) of that dll. That is what im trying to do but im not sure how to. I can get as far as making the MyProg.exe call the function1() of its dll (which works fine) but i dont know how the function1() will then use the HMODULE of the other dll to call its function2()
Thanks for your time