[PATCH] opengl32: Disable wglGetProcAddress for core GL 1.0/1.1 functions
Roderick Colenbrander
thunderbird2k at gmail.com
Tue Jun 26 00:37:30 CDT 2012
---
dlls/opengl32/tests/opengl.c | 10 ++++++++++
dlls/opengl32/wgl.c | 8 +-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index c18b0ad..a2aa358 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -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
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 7a195be..ce587d4 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -309,13 +309,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);
--
1.7.10.2
More information about the wine-patches
mailing list