diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index ffc676eab2a..c18b0ad54ca 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -797,7 +797,7 @@ static void test_getprocaddress(HDC hdc) /* Temporarily disable the context, so we can see that we can't retrieve functions now. */ wglMakeCurrent(hdc, NULL); func = wglGetProcAddress("glActiveTextureARB"); - todo_wine ok(func == NULL, "Function lookup without a context passed, expected a failure; last error %#x\n", GetLastError()); + ok(func == NULL, "Function lookup without a context passed, expected a failure; last error %#x\n", GetLastError()); wglMakeCurrent(hdc, ctx); } diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 98b04d411a7..9200dd672cc 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -300,9 +300,18 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { TRACE("(%s)\n", lpszProc); - if(lpszProc == NULL) + if (lpszProc == NULL) return NULL; + /* Without an active context opengl32 doesn't know to what + * driver it has to dispatch wglGetProcAddress. + */ + if (wglGetCurrentContext() == NULL) + { + WARN("No active WGL context found\n"); + return NULL; + } + /* First, look if it's not already defined in the 'standard' OpenGL functions */ if ((local_func = GetProcAddress(opengl32_handle, lpszProc)) != NULL) { TRACE(" found function in 'standard' OpenGL functions (%p)\n", local_func);