View Single Post
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-10-2008 , 17:14   Re: Using SourceHook
Reply With Quote #19

With what error? Maybe a call stack would help. Is g_SHPtr valid? Is engine valid? Also make sure g_PLID doesn't change (though that wouldn't crash).

When it crashes on AddHook, it might mean:
1) g_SHPtr is not a valid pointer to a CSourceHookImpl instance
2) Dereferencing the virtual table and the function entry failed. This could be the passed interface pointer not actually being of the same type as the class used for SH_DECL_HOOK
3) If something went wrong it could be a memory access error (vtables are read-only memory, SourceHook uses VirtualProtect to make it read-write, this might fail on some (security) systems).
4) Something I didn't think of at the moment went wrong.
__________________
hello, i am pm
PM is offline