opengl32: Disable wglGetProcAddress for core GL 1.0/1.1 functions.

This commit is contained in:
Roderick Colenbrander 2012-06-25 22:37:30 -07:00 committed by Alexandre Julliard
parent 2ccc5bd2c7
commit 71faef0f50
2 changed files with 11 additions and 7 deletions

View file

@ -779,6 +779,16 @@ static void test_getprocaddress(HDC hdc)
return;
}
/* Core GL 1.0/1.1 functions should not be loadable through wglGetProcAddress.
* Try to load the function with and without a context.
*/
func = wglGetProcAddress("glEnable");
ok(func == NULL, "Lookup of function glEnable with a context passed, expected a failure\n");
wglMakeCurrent(hdc, NULL);
func = wglGetProcAddress("glEnable");
ok(func == NULL, "Lookup of function glEnable without a context passed, expected a failure\n");
wglMakeCurrent(hdc, ctx);
/* The goal of the test will be to test behavior of wglGetProcAddress when
* no WGL context is active. Before the test we pick an extension (GL_ARB_multitexture)
* which any GL >=1.2.1 implementation supports. Unfortunately the GDI renderer doesn't

View file

@ -467,13 +467,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) {
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);
return local_func;
}
/* After that, search in the thunks to find the real name of the extension */
/* Search in the thunks to find the real name of the extension */
ext.name = lpszProc;
ext_ret = bsearch(&ext, extension_registry, extension_registry_size,
sizeof(OpenGL_extension), compar);