I'm hooking an object method and I'm trying to discover if there is a way to get a pointer or other reference to the calling object from within the hook handler.
static int MyHookHandlerForFoo_Bar(int someParam)
// Do hook stuff
Main This = (Main)HookRuntimeInfo.Callback;
// Call original API
Foo callingInstance = GetCallingObject() as Foo;
Here I'm intercepting a call to the Bar method by an instance of Foo. My question is what can I do to get some type of reference (or even a pointer) to the calling instance of Foo (Where the fake GetCallingObject function is), so that I can call the original
If it matters, Foo happens to be a COM object in my case.