mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Don't leak GetLastError for fully implemented functions. Closes #1942
* When we plan to return a function pointer even with no onward implementation, wglGetProcAddress will have set PROC_NOT_FOUND or some similar error. We'll still return our hook though so we need to unset that error code just in case the application is looking for it.
This commit is contained in:
@@ -563,6 +563,10 @@ static PROC WINAPI wglGetProcAddress_hooked(const char *func)
|
||||
if(realFunc == NULL && !FullyImplementedFunction(func))
|
||||
return realFunc;
|
||||
|
||||
// otherwise if we plan to return a hook anyway, ensure we don't leak the implementation's
|
||||
// LastError code
|
||||
SetLastError(0);
|
||||
|
||||
if(!strcmp(func, "wglCreateContext"))
|
||||
return (PROC)&wglCreateContext_hooked;
|
||||
if(!strcmp(func, "wglDeleteContext"))
|
||||
|
||||
Reference in New Issue
Block a user