Fixes for replay, and populating hooks (call through hooked func)

This commit is contained in:
baldurk
2014-12-03 18:16:06 +00:00
parent cb7dd8fa6d
commit d30ce5d6b2
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -592,6 +592,9 @@ class OpenGLHook : LibraryHook
{
bool success = true;
if(wglGetProcAddress_hook() == NULL)
wglGetProcAddress_hook.SetFuncPtr(Process::GetFunctionAddress(DLL_NAME, "wglGetProcAddress"));
wglGetProcAddress_hooked("wglCreateContextAttribsARB");
#undef HookInit
@@ -599,7 +602,7 @@ class OpenGLHook : LibraryHook
// cheeky
#undef HookExtension
#define HookExtension(funcPtrType, function) wglGetProcAddress_hook()(STRINGIZE(function))
#define HookExtension(funcPtrType, function) wglGetProcAddress_hooked(STRINGIZE(function))
#undef HookExtensionAlias
#define HookExtensionAlias(funcPtrType, function, alias)
+5
View File
@@ -54,6 +54,11 @@ class Hook
return (FuncType)orig_funcptr;
}
void SetFuncPtr(void *ptr)
{
orig_funcptr = ptr;
}
bool Initialize(const char *function, const char *module_name, void *destination_function_ptr)
{
orig_funcptr = Process::GetFunctionAddress(module_name, function);