Call SetLastError(0) to mute any errors after RenderDoc work

* Obviously not ideal, but better than passing spurious error codes
  back to the application where presumably it wasn't getting them
  before.
This commit is contained in:
baldurk
2015-09-18 23:31:34 +02:00
parent 4242c12226
commit 8678fa9e2d
2 changed files with 17 additions and 1 deletions
+12
View File
@@ -384,6 +384,8 @@ class OpenGLHook : LibraryHook
glhooks.GetDriver()->CreateContext(data, NULL, GetInitParamsForDC(dc), false, false);
SetLastError(0);
return ret;
}
@@ -391,6 +393,8 @@ class OpenGLHook : LibraryHook
{
glhooks.GetDriver()->DeleteContext(rc);
SetLastError(0);
return glhooks.wglDeleteContext_hook()(rc);
}
@@ -405,6 +409,8 @@ class OpenGLHook : LibraryHook
glhooks.GetDriver()->CreateContext(data, NULL, GetInitParamsForDC(dc), false, false);
SetLastError(0);
return ret;
}
@@ -480,6 +486,8 @@ class OpenGLHook : LibraryHook
glhooks.GetDriver()->CreateContext(data, hShareContext, GetInitParamsForDC(dc), core, true);
SetLastError(0);
return ret;
}
@@ -516,6 +524,8 @@ class OpenGLHook : LibraryHook
glhooks.GetDriver()->ActivateContext(data);
SetLastError(0);
return ret;
}
@@ -531,6 +541,8 @@ class OpenGLHook : LibraryHook
glhooks.GetDriver()->WindowSize(w, r.right - r.left, r.bottom - r.top);
glhooks.GetDriver()->SwapBuffers(w);
SetLastError(0);
}
return glhooks.SwapBuffers_hook()(dc);
+5 -1
View File
@@ -80,7 +80,11 @@ BOOL APIENTRY DllMain( HMODULE hModule,
)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
return add_hooks();
{
BOOL ret = add_hooks();
SetLastError(0);
return ret;
}
return TRUE;
}