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

Alexandre Julliard julliard at winehq.org
Tue Jun 26 13:34:13 CDT 2012


Module: wine
Branch: master
Commit: 71faef0f503c248c4d9c94c2be2fcbc3c9c93741
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=71faef0f503c248c4d9c94c2be2fcbc3c9c93741

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Mon Jun 25 22:37:30 2012 -0700

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

---

 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 79aefcd..eca42e2 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -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);




More information about the wine-cvs mailing list