mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user