I have a situation where there are 2 dlls. One (call it Fred.dll) contains some thrid-party code which I need to prevent programs calling directly. I need to create a DLL to replace Fred.dll which actually handles the calls and passes some of them through to the original Fred.dll.
What I've got at the moment is a situation where the Slave DLL imports some of the functions exported by the master, wraps them in a function wrapper of the same prototype and then exports this wrapper.
This is fine in cases where I know the exact prototype of the function. However, I also need to be able to pass calls through to the Master without knowing the full function prototype - prefably without having to write a wrapper function. I would have thought this should be possible, since the OS doesn't care about the parameters anyway, it just passes a function pointer - or am I wrong here as well?
Has any one got an idea of how I can solve this problem?