IPC interface problems - c# app, c++/cli dll injected into 32 bit process

Mar 29, 2010 at 4:39 PM

I have a c# project with a c++/cli dll using the managed easyhook library. My test app works fine, I can inject my dll into the target process fine and perform hooks / execute code etc.

I have an IPC server running in my application simmilar to the filemonitor example and another server in the target DLL so my app can call code from the c++/cli side.

if I define the classes for the IPC servers (i.e like filemoninterface) in my main c# application , everything seems to work ok and I can make IPC calls fine.

If I define the classes used for IPC in the c++/cli  project, not changing anything else, everything compiles fine, but on execution it throws the following exception;

Unhandled Exception: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
 at Poker.Program.Main(String[] args)

I need to have the class for the injected dll defined in the C++/cli project as it will make heavy use of some native functionality.

Is this possible, am i doing something stupid / horribly wrong?

Mar 30, 2010 at 4:14 PM

Incase someone else has this issue, here is my workaround. I am sure it is me doing something wrong rather than an issue with easyhook.

I created a seperate test rig of this problem and found that this issue still occured when I declared the IPC classes in the c++/cli class library and included the headers for the native libraries I was working with. When I moved the IPC classes to the main c# application performing the injection it was fine, if I left them in the c++/cli library it was fine unless I put the native includes in there.

I ended up creating another c++/cli class library with the native includes and exposed the native code via a new set of classes. I moved the IPC classes back to the c++/cli injected library and all is now working.

No idea what was going wrong. Thanks for your awesome work.